I was working on eve. It is an open source Python REST API framework designed for human beings. It allows to effortlessly build and deploy highly customizable, fully featured RESTful Web Services. It is powered by Flask, Redis, Cerberus, Events and offers support for both MongoDB and SQL backends.
Token-based authentication can be considered a specialized version of Basic Authentication. The Authorization header tag will contain the auth token as the username, and no password.
I was trying to implement this example. Suddenly i was stuck while verifying the authentication. It always report 401 unauthorized error with postman. then i jumped to IRC, stack overflow and everywhere i could, to find the solution to this issue. Finally after a time i figured out the problem.
The things which have to be taken care are :
- Authorization should be passed in header of request
- Header->Authorization ; Value->Basic[space][key_value]
- key_value->base64 encoded(token)
- token should end with “:“
Base 64 encoding of token can be done here. Just remember your token should end with : . As the token authentication of eve, picks the decoded part of token before : only.
Enjoy the response 200 ;)