-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat(core/providers): Add Vipps Login Provider #6713
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
46282b1
to
47d41a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I added some comments. Besides, could you add an option to the issue template? 🙏
packages/core/src/providers/vipps.ts
Outdated
} | ||
|
||
interface AdditonalConfig { | ||
redirectUri?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't used anywhere
packages/core/src/providers/vipps.ts
Outdated
client_id: options.clientId, | ||
response_type: "code", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
client_id and response_type is automatically added, so I think you can remove them here
response_type: "code", | ||
}, | ||
}, | ||
userinfo: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I meant you could use the wellKnown
option with idToken: true
, described here: https://authjs.dev/reference/providers/oauth#userinfo-option
since this is an OIDC-compliant provider, we should be able to extract the user info without making a request to that endpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last time I checked idToken wasn't a type on OIDCConfig. Should I add it?
I read that next-auth still will try and contact said endpoint tho
return await response.json() | ||
}, | ||
}, | ||
profile(profile) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
profile isn't needed afaik
Ok, so after ace052b I seem to get the decoded id_token as the OAuthProfile. Is that correct? |
However, if I bring back the changes from ab8da6c as well as including a custom request for the userinfo and adding the profile function back, I get "actual" profile data with email, name..etc @balazsorban44 If I may ask, what was the reason for 740a2db, as that is where I took it from. Is it needed for Vipps too you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to test this locally before merging. I'm currently struggling with Vipps Support to check why my redirect url is not accepted. 🙏
The Vipps provider is a standard OIDC provider, so userinfo.request
should be unnecessary as it's reserved for non-compliant providers as an escape hatch. I'm looking into this. 👍
Thank you! Let me know if I can help you with anything :) |
@balazsorban44 did you resolve your issue with the redirect url? :) |
ecad815
to
cd63188
Compare
cd63188
to
5fb323e
Compare
@itschip is attempting to deploy a commit to the authjs Team on Vercel. A member of the Team first needs to authorize it. |
@balazsorban44 Do you think it is fine to just use 'oauth' for now. I am currently using that for my project now, and it works fine. If not I'll try once more with 'oidc', even though I have not had any luck with it yet. |
c3fa7f0
to
6c07331
Compare
5fb323e
to
5cf697c
Compare
9784f29
to
37bb6eb
Compare
fa96b45
to
65aa467
Compare
☕️ Reasoning
This PR adds Vipps Login API to next-auth. One of the most popular login methods used in Norway.
Completes #6424 (Credits to @endrekrohn for the initial PR)
🧢 Checklist
🎫 Affected issues
None
📌 Resources