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

Switch BattleNet to OIDC #4015

Merged
merged 8 commits into from Feb 22, 2022
Merged

Switch BattleNet to OIDC #4015

merged 8 commits into from Feb 22, 2022

Conversation

Stono
Copy link
Contributor

@Stono Stono commented Feb 19, 2022

Reasoning 💡

The current battlenet provider is broken, this switches it to a OIDC provider instead.

It switches it to a typescript file from a js file too.

Checklist 🧢

  • Documentation
  • Tests (tested locally)
  • Ready to be merged

Affected issues 🎟

Fixes: #4013

@vercel
Copy link

vercel bot commented Feb 19, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nextauthjs/next-auth/hSaq7uBf7MfqU9ACkGf6hzu5mZKw
✅ Preview: Canceled

[Deployment for 8571a03 canceled]

@Stono Stono changed the title Fixes: https://github.com/nextauthjs/next-auth/issues/4013 Switch BattleNet to OIDC Feb 19, 2022
@github-actions github-actions bot added core Refers to `@auth/core` providers labels Feb 19, 2022
@Stono
Copy link
Contributor Author

Stono commented Feb 19, 2022

I'm new to next-auth btw so still finding my feet. I've noticed account linking only works when you have the same email address (and you're logged in when the flow starts).

Battlenet doesn't return an email address 🤷

I assume to do account linking here i need to wait for the api (next release?)

Copy link
Member

@balazsorban44 balazsorban44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I left some comments to clean the config up.

As proof, could you also take a screenshot of your logged-in user so we know it actually works? Good to have as a future reference.

@balazsorban44
Copy link
Member

I've noticed account linking only works when you have the same email address (and you're logged in when the flow starts).

This is correct. The default linking probably won't change, but you can use the adapter.linkAccout method (with proper security in mind on your side since it would be user-land code) however you like to connect accounts.

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
@Stono
Copy link
Contributor Author

Stono commented Feb 20, 2022

Can't show you my signed in user because i'm not actually allowing people to sign in with this, i'm trying a convoluted way to get account linking to work.

However here i've console logged out the details in the signin method so you can see it's working:

token
signin

@Stono
Copy link
Contributor Author

Stono commented Feb 20, 2022

I've noticed account linking only works when you have the same email address (and you're logged in when the flow starts).

This is correct. The default linking probably won't change, but you can use the adapter.linkAccout method (with proper security in mind on your side since it would be user-land code) however you like to connect accounts.

Locally where would the most appropriate place for me to do that be? For context i'm trying to sign in using Credentials but then link several oauth'd accounts.

@balazsorban44
Copy link
Member

Should be a discussion, not a comment on this PR 😉

@balazsorban44 balazsorban44 merged commit 75cb175 into nextauthjs:main Feb 22, 2022
@balazsorban44
Copy link
Member

I standardized the changes of this PR in a follow-up commit here: 163149b

Basically, we should be using issuer cause that's the common reference in OAuth.

@codal-Jamie
Copy link

Running into id_token detected in the response, you must use client.callback() instead of client.oauthCallback() and the already mentioned issue with the Facebook provider too. Can the Facebook Provider also be updated to address the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Refers to `@auth/core` providers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BattleNet Provider doesn't work (few issues)
3 participants