nextauthjs / nextauthjs/next-auth
Instagram Provider Problems(Login with user_id, Live-Mode Login and Login using the Instagram App[android])
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 28.4k
- Forks
- 4k
- PR merge metrics
- No merged PRs in 30d
Description
Provider type
Environment
System:
OS: Windows 10 10.0.22621
CPU: (16) x64 AMD Ryzen 9 6900HS with Radeon Graphics
Memory: 4.03 GB / 15.24 GB
Binaries:
Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.22621.963.0), Chromium (108.0.1462.76)
Internet Explorer: 11.0.22621.1
npmPackages:
next: 13.1.0 => 13.1.0
next-auth: ^4.15.1 => 4.16.4
react: ^18.2.0 => 18.2.0
Reproduction URL
https://danger-radar.mauroner.eu/
Describe the issue
There are multiple problems with the current implementation of the Instagram provider:
GitHub Repo
1. Signin Problem
This code snippet has to be added otherwise it doesn't work, because from what I can see Instagram returns both a userId and a user_id.
async signIn({ account }) {
account && account.user_id ? delete account.user_id : null;
return true;
}
2. Using Instagram as Auth on Android (using the included Instagram App browser)
This results in this error being thrown on the client (collected with this ErrorBoundries file)
{"hasError":true,"error":[{},{"componentStack":"\n at b (https://danger-radar.mauroner.eu/_next/static/chunks/pages/index-26834f2c54f26c51.js:1:7034)\n at e.SessionProvider (https://danger-radar.mauroner.eu/_next/static/chunks/pages/_app-441659a397602ebd.js:1:8484)\n at u (https://danger-radar.mauroner.eu/_next/static/chunks/pages/_app-441659a397602ebd.js:1:20660)\n at a (https://danger-radar.mauroner.eu/_next/static/chunks/pages/_app-441659a397602ebd.js:1:20730)\n at A (https://danger-radar.mauroner.eu/_next/static/chunks/pages/_app-441659a397602ebd.js:5:3190)\n at k (https://danger-radar.mauroner.eu/_next/static/chunks/pages/_app-441659a397602ebd.js:5:2887)\n at i (https://danger-radar.mauroner.eu/_next/static/chunks/pages/_app-441659a397602ebd.js:5:29698)\n at o (https://danger-radar.mauroner.eu/_next/static/chunks/pages/_app-441659a397602ebd.js:5:69141)\n at t.PathnameContextProviderAdapter (https://danger-radar.mauroner.eu/_next/static/chunks/main-7d940300c35db35d.js:1:44269)\n at z (https://danger-radar.mauroner.eu/_next/static/chunks/main-7d940300c35db35d.js:1:7687)\n at X (https://danger-radar.mauroner.eu/_next/static/chunks/main-7d940300c35db35d.js:1:9516)\n at en (https://danger-radar.mauroner.eu/_next/static/chunks/main-7d940300c35db35d.js:1:12277)"}]}
3. Using Instagram in Live doesn't appear to be working
I have tried to solve this problem for many hours and have not come up with a solution. When using the "Live" mode of the app and trying to log in using Instagram, the login is only successful if the User is a Test-User.
{"error_type": "OAuthException", "code": 400, "error_message": "No valid scopes requested"}
This could be an Instagram problem, but any help is appreciated.
How to reproduce
- Login Using the Instagram Provider on the Android App with Instagrams internal browser(might not work because of Problem 3)
- Implement the Instagram provider as instructed by the documentation
- Login Using the Instagram provider while the app is set to live mode and the user that is trying to login is not a Test-User
Expected behavior
- This should throw me back into the browser and website I came from
- This should just log me in like the GitHub or Discord provider
- This should log me in once the app is in Live mode, without regard for the Users roles(at least that is what I understood reading the Instagram documentation)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the Instagram provider implementation alongside the linked reproduction and the reported ErrorBoundry.tsx output. Reproduce the user_id, Android in-app browser, and Live-mode non-test-user flows, then verify that each expected login behavior works or that any provider-side limitation is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- next.js, node.js, react, typescript
- Domain
- api, authentication
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100