-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Not getting the ID token, only the access token from Okta #378
Comments
The The only way to access additional properties is if using JSON Web Tokens (in the JWT callback) or from the Sign In callback. If you are using JWT sessions you should be able access the full profile object on sign in via the JWT callback, you can copy objects over from the profile to the JWT to persist them when it the callback is invoked on sign in. If you are using database sessions, then you should be able to grab the profile in the Sign In callback, but you'd have to write some code to handle care of saving it to a database table somewhere, as it's not persisted by default. (It is possible to use custom models to persist the info in a database with NextAuth.js but we don't have a guide for that yet!) |
Hello, I was curious if there is a reason why the |
Hi there! Essentially we try to be as compatible with as wide range of providers as possible so the design is generally starts off by reflecting the flow of the majority of providers, and is refined as we add more providers that share similar behaviour (as there is no single spec to follow, but rather a range of specifications, including Open ID which attempts so solve that problem by codifying more of it). Open ID token support is an example of something we implemented in a way to fit in with the majority of existing providers work, so it's sort of wrangled into the profile model used by other OAuth services. I think we will probably move towards trying to make available as it's started to come up in discussions that folks would like to be able to pass the signed JWT that comes back from the provider to other services. We could add another option to the callbacks and return the raw JWT response the same way we do for providers, and/or we could persist it in the database, along with other provider specific information. We could also provide an endpoint where it can be extracted from (which might in turn require a database, depending on how individual providers work). To make a call on that I think we'll probably want to take a look at the Open ID spec and then see how providers that use it implement it in practice to find common ground. |
@iaincollins thanks for the reply! Personally, I like your suggestion of adding the option to the callbacks to return the raw JWT response for the |
Any updates on this? |
Hi there! It looks like this issue hasn't had any activity for a while. It will be closed if no further activity occurs. If you think your issue is still relevant, feel free to comment on it to keep ot open. Thanks! |
Hi @erik617, did you ever manage to expose your |
I think #837 would do what you need. |
@balazsorban44 You're right - it's exactly what I need! |
I also want to get the idToken using jwt callback.
I can see profile contains the id. But how do I get the actual JWT idToken?
My provider setup:
|
+1, same issue for me too. Need access to id_token for Sign in with Apple! :) |
🎉 This issue has been resolved in version 3.2.0-canary.10 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 3.3.0-canary.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Should I be able to get the ID token when using Okta?
I have a working project using Okta. I am requesting the following scopes in my [...nextauth].js file...
scope: "openid profile email offline_access"
The Okta docs indicate the id_token is included in the response from /v1/token if the "openid" scope was requested.
console output of "message" in session Event...
The access token decodes to
The text was updated successfully, but these errors were encountered: