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

feature request: Support issuing Access Token JWTs with typ other than at+jwt (e.g. JWT) #6915

Open
ChrisSamo632 opened this issue Dec 30, 2024 · 4 comments
Assignees
Labels
feature-request Something cool or not cool pending-verification Something is still under investigation

Comments

@ChrisSamo632
Copy link

What problem did you meet?

LogTo Access Token JWTs are always issued with a typ of at+jwt, but not all services are able to consume these tokens, for example Elasticsearch (elastic/elasticsearch#119370) or any Spring-based application using the default JWT Decoder (as noted in the LogTo docs - https://github.com/logto-io/logto/blob/master/packages/console/src/assets/docs/guides/api-spring-boot/README.mdx).

For example, when requesting by an Access Token JWT machine-to-machine Application for an API Resource and permitted scopes - the JWT is returned without issue by LogTo, but then cannot be consumed by the target application.

Describe what you'd like Logto to have

An option to return Access Token JWTs with typ of JWT for use in a wider number of target applications

Copy link

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Jan 14, 2025
@ChrisSamo632
Copy link
Author

Any chance this can be looked at? It would be better to be able to use Access Tokens for Auth in systems that only support JWTs with a typ of JWT

@github-actions github-actions bot removed the stale label Jan 15, 2025
@simeng-li simeng-li added the pending-verification Something is still under investigation label Jan 20, 2025
@simeng-li
Copy link
Contributor

Hi thanks for asking,

Logto follows OIDC standards, and during a user authentication and authorization flow, both ID tokens and access tokens will be issued. To ensure that the ID token is not mistakenly recognized as the access token, the JWT token type at+jwt is used. This is why in OIDC, the at+ prefix is mandatory for access tokens. As noted in our Spring Boot API example, you'll need to customize the decoder rule slightly to validate the token typ properly and ensure accurate handling of both token types.

@simeng-li simeng-li self-assigned this Jan 20, 2025
@ChrisSamo632
Copy link
Author

I guess the problem is that not everyone follows the same RFCs in the same way, which is what leads to this kind of thing.

While I've raised a related Issue on Elasticsearch, that's not a component to which I can make the suggested change.

@simeng-li simeng-li added the feature-request Something cool or not cool label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Something cool or not cool pending-verification Something is still under investigation
Development

No branches or pull requests

2 participants