-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Error logging in with google or fecebook #14029
Comments
Hi @AndresCi2 thanks for opening this issue. Normally |
Hello if the value I am using is the domain of amplify.com that is generating the amplify amplification when it was created. |
And do the domains from both match? Could you provide the full url when it redirected back and the actually evaluated value of the |
of course this is my url which I have configured in redirectSignIn “desarrollo.d22q0x5cvvqgsb.amplifyapp.com” but when I try to redirect in browser console I find this error InvalidOriginException: redirect is coming from a different origin. The oauth flow must be started from the same origin. |
As I don't have visibility into your project set up and env vars. You may try to check the following:
|
Hi, I was reviewing the steps you indicated and indeed the url of allowed calls and logout is the same as the one I am using. |
Hi @AndresCi2 I attempted debugging with your website again, I saw the urls you provide for You would need to ensure the urls you provided match the hosting domain. |
Hi @AndresCi2 please let us know is there anything else that we can help on the Amplify JS library side. |
hello no all is well at the moment |
Thanks for the follow up, I'm closing this issue now as the original issue has been resolved. |
Before opening, please confirm:
JavaScript Framework
Next.js
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
No response
Backend
None
Environment information
Describe the bug
Hi, I am trying to use the signInWithRedirect function to log in with google and facebook and in the platforms of each social network I have already added the urls to be able to make the redirections but when I want to redirect I get the following error “Uncaught (in promise) InvalidOriginException: redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin” I don't know what I need to configure, I tried to adjust several processes and before I had version 4 of amplify and it worked, recently I updated to version 6.
Expected behavior
this is my configuration
Auth: {
Cognito: {
userPoolId: env.NEXT_PUBLIC_COGNITO_USERPOOL_ID,
userPoolClientId: env.NEXT_PUBLIC_COGNITO_CLIENT_ID,
signUpVerificationMethod: 'code',
loginWith: {
email: true,
oauth: {
redirectSignIn: [
${BASE_URL}/auth/signin
],redirectSignOut: [
${BASE_URL}/auth/signin
],domain: env.NEXT_PUBLIC_COGNITO_DOMAIN,
responseType: "code",
scopes: ["email", "openid", "profile", "aws.cognito.signin.user.admin"]
},
}
}
}
Reproduction steps
this is my code
await signInWithRedirect({
provider: 'Google',
customState: 'shopping-cart'
});
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
Auth: {
Cognito: {
userPoolId: env.NEXT_PUBLIC_COGNITO_USERPOOL_ID,
userPoolClientId: env.NEXT_PUBLIC_COGNITO_CLIENT_ID,
signUpVerificationMethod: 'code',
loginWith: {
email: true,
oauth: {
redirectSignIn: [
${BASE_URL}/auth/signin
],redirectSignOut: [
${BASE_URL}/auth/signin
],domain: env.NEXT_PUBLIC_COGNITO_DOMAIN,
responseType: "code",
scopes: ["email", "openid", "profile", "aws.cognito.signin.user.admin"]
},
}
}
}
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
linux
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: