While creating REST API, what is the best practice to use authentication token. API should except the authentication token in url itself or in HTTP-HEADER. What is the best place for the authentication token and why?
1 Answer
Best practice is to check out one of the common authentication protocols and probably use an existing stable implementation of it.
OAuth2 is the obvious choice - http://oauth.net/2/
2 Comments
user3432824
I do agree with you. But there we must have do it by this way. So we don't have choice.
Rotem Hermon
In any case, sending the token as a parameter in the URL is less secure since there's a good chance it will be logged somewhere along the way (on the web server, proxy server etc.).