Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added requestUsingIDToken configuration #406

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

ddaddy
Copy link

@ddaddy ddaddy commented Jul 21, 2023

Fixes #405 as it allows the use of the id_token instead of the access_token when signing requests.
This is handy when using AWS Cognito with AWS API Gateway.

@jozefizso
Copy link
Contributor

I don't think this is a good change.,

The ID token should not be used for authentication.

As said above, an ID token proves that a user has been authenticated. In a first-party scenario, i.e. in a scenario where the client and the API are both controlled by you, you may decide that your ID token is good to make authorization decisions: maybe all you need to know is the user identity.

However, even in this scenario, the security of your application, consisting of the client and the API, may be at risk. In fact, there is no mechanism that ties the ID token to the client-API channel. If an attacker manages to steal your ID token, they can use it to call your API like a legitimate client.

If your API accepts an ID token as an authorization token, to begin with, you are ignoring the intended recipient stated by the audience claim. That claim says that it is meant for your client application, not for the resource server (i.e., the API).

You may think this is just a formality, but there are security implications here.

https://auth0.com/blog/id-token-access-token-what-is-the-difference/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Force to use id_token instead of access_token
2 participants