Considering the following scenario in a context of the SSO/OAuth/microservices:
Now, is this OK to pass on the user's Access Token from Service A to Service B?
Or should Service A use "Client Credentials" grant to obtain its own Access Token to authorize call to the Service B?
UPDATE:
Please assume both services are owned by the same organization and both trust the same Authorization Server. Also both services are behind the same API Gateway which validates Access Tokens.
So, if the client and the OAuth server both use https, would it be ok to send access tokens in url? Not really, URLs are still liable to be logged at the end server, which means the access token can still be leaked if an attacker was to get access to server logs. This is still susceptible to shoulder-surfing.
The token is considered very sensitive information because it allows access to the service. Anyone could issue requests if they had this token. This is why the token is passed in the Authorization Header, this is why it's highly recommended you make all calls over https, to protect the headers and body information.
Using the access token you be able to use the same token for multiple transactions as long as it is valid.
Your authentication tokens should be: Private. Users can't share token authentication devices or pass them around between departments. Just as they wouldn't share passwords, they shouldn't share any other part of your security system.
It depends on who is controlling the web application, Service A and Service B. If they're all run by the same party there's no problem in passing the token on since it stays within the same security domain.
But if e.g. Service B is run by a 3rd party then things become problematic as the administrator of Service B can pickup the access token and call Service A as if it were your web application, potentially getting access to resources that it should not have access to.
You'll also note that if Service A and Service B are owned by 2 different parties, other than you, your web application should also obtain two different access tokens respectively for calling Service A and Service B to prevent the same security issue.
So the answer really is: it depends on who is controlling what i.e. if the token is crossing an administrative/security domain.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With