mattrogowski
Well-known member
Looks like whatever library you’re using is requesting a scope that doesn’t exist, this isn’t an OpenID implementation so there is no openid scope.
What implementation is it then?Looks like whatever library you’re using is requesting a scope that doesn’t exist, this isn’t an OpenID implementation so there is no openid scope.
I gotta contact auth.js thenIt’s just standard OAuth.
To resolve this issue, you can take one of the following approaches:Can't find the openid scope
View attachment 292056
authorization: { url: "https://<your_xf_forum_domain>/audapi/oauth2/authorize", params: { scope: "user:read thread:read etc:etc" }}
authorization: { url: "https://<your_xf_forum_domain>/audapi/oauth2/authorize", params: { scope: "" }}
Just got back to this old project. Can't go past it. Hopefully the native OAuth api will fix itTo resolve this issue, you can take one of the following approaches:
However, I haven't yet found a solution to make this work beyond the authorization stage of the OAuth2 workflow. I'm encountering a 401 unauthorized error as soon as it redirects back to my Next.js app. Does anyone have any insights on how to resolve this issue with NextAuth.js?
- Hardcode the scopes in the params object like this:
JavaScript:authorization: { url: "https://<your_xf_forum_domain>/audapi/oauth2/authorize", params: { scope: "user:read thread:read etc:etc" }}
- Allow NextAuth to use all the scopes enabled in your OAuth2 Client setup for this addon during the authorization process by leaving the scopes property in the params object as an empty string:
JavaScript:authorization: { url: "https://<your_xf_forum_domain>/audapi/oauth2/authorize", params: { scope: "" }}
I'm finally able to send scopes, with the suggestion @W35K3R gave earlier. It's that I still get 401 everywhere. The xenforo's native oauth will also probably be better documented so I might have a better chance than navigating trough php code as a javascript developer.Not sure what you mean, are you referring to the ability to use XenForo as an OAuth server in 2.3? From what's been covered about that you'll still need to send scopes. Either way, the issues you had here were entirely due to the client library you're using, so you'll likely continue having the same issues.
Callback is throwing 401What step is throwing the 401? I'm not sure what else you would like us to document as OAuth is an open standard so every implementation works the same way by definition. Aside from the endpoint URLs, there's nothing specific for us to document that's unique to this addon.
/api/me
), you need to pass through the XenForo API key header too. That would need to be implemented into the library as the API calls are all standard XenForo, this addon just gives you the OAuth token aspect.Callback is throwing 401
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
I'm using nginx, and it didn't return anything other than 401 UnauthorizedWhat "callback"? Is there a specific XF endpoint you're using? There should be an error message to go with it. Not really much we can provide if we're given no details on the issue, sadly.
Best guess would be if you're using Apache it will sometimes eat the Authorization header in certain configurations, there is a line in the default XenForo .htaccess file that you can uncomment to resolve this, nothing to do with this add-on, just a server configuration problem.
The line you can try to uncomment is below:
Code:RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
Do you know of any other libraries?It should definitely be returning a message string in the response body too, log out the full response and it should be there. Also check my previous post about how your library is sending the credentials to get the token. Ultimately there's not a lot we can do if we have no idea what your client library you're using is doing and how it's formatting the requests, or what the error message received is.
Oh great! Is it still working?@Sprisa, my developer buddy figured out how to make this work with NextAuth. I'll generalize the custom provider code he created, and I'll get back to you on this as soon as I can. In the meantime, and if you haven't already done so, can you post what you have set up for the XenForo OAuth2 provider in regards to this add-on for your project? @mattrogowski, the add-on is not the issue; rather, there's a peculiar workflow implementation with NextAuth that has to be done a certain way to get the two to work together. You'd think they'd make this easy to integrate with custom OAuth2 providers lol, but it's never that easy, unfortunately
We use essential cookies to make this site work, and optional cookies to enhance your experience.