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

Support for Access Token in Pre Token Generation triggers #402

Open
jmenziessmith-vemi opened this issue Feb 17, 2025 · 1 comment
Open

Comments

@jmenziessmith-vemi
Copy link

It seems that token value overrides only work for ID Tokens, and are not applied to access tokens. Is this correct?

I have found the following code which suggests that is the case.

https://github.com/jagregory/cognito-local/blob/3113beea3e34d854c879b306be83f3156f3e92b4/src/services/tokenGenerator.ts#L194C17-L194C36

according to https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html it is possible in V2 to override access token values as well.

My use case is that I need to add additional claims to the access token. While I can do this with the ID token, my understanding is that it is not suitable to use the ID token as the bearer token in requests to other services.

Is it possible to add support for the access token overrides? Thanks

@jagregory
Copy link
Owner

I haven't added any support for the newer Cognito features, so you're correct that this isn't supported.

I don't personally need this feature so I'm unlikely to have capacity to build it, but I'll advise on a PR if you have the time.

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

No branches or pull requests

2 participants