You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently using nextjs and react with pocketbase and when I try to authenticate via OAuth2, I get a code 400 response "Failed to authenticate.".
I am unfortunately unable to determine why this error is occurring. Maybe someone of you can give me a hint.
First I collect the authProviders:
export async function getStaticProps() {
const authProviders = (await client.users.listAuthMethods()).authProviders;
return {
props: {authProviders}, // will be passed to the page component as props
}
}
I then iterate through these:
const providersMap = authProviders.authProviders.sort((a, b) => b.name.localeCompare(a.name)).map(provider => {
and create a button per authProvider that calls the following function via onClick:
From the provider I have the attributes "codeChallenge", "codeChallengeMethod", "codeVerifier", "name", "state" and "authUrl" to choose from. Am I using these incorrectly?
The documentation only talks about a parameter called code and not codeChallenge:
import PocketBase from 'pocketbase';
const client = new PocketBase('http://127.0.0.1:8090');
...
const authData = await client.users.authViaOAuth2('google', 'CODE', 'VERIFIER', 'REDIRECT_URL');
I hope you could understand my problem so far and have a solution or hints for me :)
The text was updated successfully, but these errors were encountered:
You can also start PocketBase with --debug to get more detailed error messages in the console since it could be caused by incorrectly setup provider OAuth2 app or something related to the scopes.
Hi guys,
I am currently using nextjs and react with pocketbase and when I try to authenticate via OAuth2, I get a code 400 response "Failed to authenticate.".
I am unfortunately unable to determine why this error is occurring. Maybe someone of you can give me a hint.
First I collect the authProviders:
I then iterate through these:
const providersMap = authProviders.authProviders.sort((a, b) => b.name.localeCompare(a.name)).map(provider => {
and create a button per authProvider that calls the following function via onClick:
signInWithOAuth2(provider.name, provider.codeChallenge, provider.codeVerifier, 'http://localhost:3000/')
this method then looks like this:
From the provider I have the attributes "codeChallenge", "codeChallengeMethod", "codeVerifier", "name", "state" and "authUrl" to choose from. Am I using these incorrectly?
The documentation only talks about a parameter called code and not codeChallenge:
I hope you could understand my problem so far and have a solution or hints for me :)
The text was updated successfully, but these errors were encountered: