Closed rush86999 closed 6 months ago
Hello, @rush86999 👋. I'm working on reproducing this issue and wondering if you could share maybe a screenshot of what the request/response looks like to Cognito when attempting to do the federated sign in. Would you mind capturing that and sharing it? Also, can you see if removing "phone"
from the scope
array changes the behavior?
@cwomack When you say the request/response, do you mean from under the network tab?
You can test it here as well: https://app.atomiclife.app/User/Login/UserLogin
Should I try to remove phone scope via amplify update auth
?
I also have Hub.listen event listener inside _app.ts file if you need to see the code for this let me know.
Do I manually remove the phone scope from the Cognito console? Is there an option via the cli?
response does not show up but here's the payload:
access_type: offline
client_id: 159344105155-l3g18r35mrk7js66pin9lrdjs34k99k0.apps.googleusercontent.com
redirect_uri: https://fireapp37222ab0-37222ab0-prod.auth.us-east-1.amazoncognito.com/oauth2/idpresponse
response_type: code
scope: openid email profile
state: H4sIAAAAAAAAAE2SW4_aMBCF_4ufSciVEN66hCWwlEuzbEKrCtmxTQxx7s6t6n-vqdRVn3yOfObzaMa_AAQLIGqFwLpR9CtycHnu_U0KJgDJm3We31IiTSzNTC_ZTVhGOUPIrdKqvRclNR23KGUAy0DSNEW9mE5hUaiwyTmLU0aJKu10KiNERuIcP3H0f_YNLH6AIsmzpyEcsufreUEyhqUoqpyyvznY1Wqc3zLW5GrN5JmpoiaVCjFnGfg5AYmkmihzvNPF0szZ_cswhh0X_SMNB3oOfbwvtpLDZOxEro4eHDZ6NDLPQH4E98k1LJ3rN_pyMIuhxWbUn8O-P2xkxV1WBIY9k_Ih5db4_nI_rdyxod12qAd7-dqL1yw-thzl8dCtdm3JhSGiTSXeo6h984hADvpIBPYDXiXe-mMZOftq5ZDYHjU7rY_Iby6k-NoEmJb43a6UyBPbXXY80Yo_aOe57fxhWKMbr0M_aHzqkk73Lt3baB72uxAF7ZUvneH0thT6ZVluGkh6uKsDS3acyo4pq4hcg-kYhgGRpnwKOV2sQtEk6ucnUCGHY579m3SccwnhYKHP3Lntuq41l0sBCwrTmkxA9aTPqYmMWawgommKZVhYQaZGFapjqEMt1qFDwO8_eNDvZmwCAAA.H4sIAAAAAAAAAAEgAN__-GfYNe1shpTrWJb2tZJMkersYjCnu8mDxCe_Jlu0Kv3RUUigIAAAAA.4
service: lso
o2v: 2
theme: glif
continue: https://accounts.google.com/signin/oauth/consent?authuser=unknown&part=AJi8hANsy65wPbWrrbmh4M5QvtD9HyMvYt2fzTyIslyF0eV_9HRhvPPYMGhjv-Qj8PnniD8W_byzVXZKHTFE9fWFJOj8nQjz2TRm7BtPIZv3RqmTm6xDN5cvwH2JHjaGWuBw96IXO6Xy8hTwcUapq239huCCZVDX1pZULYzxZjVwnw0zCHOaIou4HJjtu7r_NVBJRTKsIbI5b7iqN_3Mareq9226fIv4dTH84yI-lBPWL-Qc_S2bk42FaeI8K3dS3zkAikv-vlwi81qFoa_h_CM6zQDxDsDFcU_Q968JynxCDv93ory1Jd31t-N5DITFuXI-2zOAz1kkjZ6QbuPSL6ZUIFNIyG71flzOmENeEAh_jg_0RAWmivfDidAm4SLaBqQWPGj3wc_-IBGCAW_VQqLRcna2r2XnW1I2-33BfORNhLXbvBIilWYeoAnfI_Ta1VMfXMGY8ZkM7cHD1QCuNz1r2oU0_kCczY8KW7XzJgzOell5u3Bd8yO052Ed8Od4hyykKLk5AM4W4DWZ7wUCnIDC1P051govwQ&as=S-1744716102%3A1698599948198764&client_id=159344105155-l3g18r35mrk7js66pin9lrdjs34k99k0.apps.googleusercontent.com&theme=glif#
f.req: ["AEThLlzp3afSzhLZCzobLkJx9g5CsBWO1-7oJvWEvpEGOgV1GpMduNNxTBq4hvSsbqpLam0-ghVg45kVtyfaHmW2MqVEnr2AnDZithIwQaAzs9w-7RKWObQlcJtQQ1QvKDJypRRA-7LTtP8-gKyiMWUaMMQSG8cj6ri_nSKkBUro6S7yAwva_5gkr-2oEy1qYVTo8MIsRcuIDT1BXlTVC8It9NemcjzrVVTykcBnmIflAkM2UbkwkfeQBzbJ4AXEZmH1hgR5FSRuPfujzZ2nnGtpjwZSt37l_U7umAfK5RBm77SjhDto4CCgK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w",0,0,null,[null,null,[2,1,null,1,"https://accounts.google.com/signin/oauth?client_id=159344105155-l3g18r35mrk7js66pin9lrdjs34k99k0.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Ffireapp37222ab0-37222ab0-prod.auth.us-east-1.amazoncognito.com%2Foauth2%2Fidpresponse&scope=openid+email+profile&response_type=code&state=H4sIAAAAAAAAAE2SW4_aMBCF_4ufSciVEN66hCWwlEuzbEKrCtmxTQxx7s6t6n-vqdRVn3yOfObzaMa_AAQLIGqFwLpR9CtycHnu_U0KJgDJm3We31IiTSzNTC_ZTVhGOUPIrdKqvRclNR23KGUAy0DSNEW9mE5hUaiwyTmLU0aJKu10KiNERuIcP3H0f_YNLH6AIsmzpyEcsufreUEyhqUoqpyyvznY1Wqc3zLW5GrN5JmpoiaVCjFnGfg5AYmkmihzvNPF0szZ_cswhh0X_SMNB3oOfbwvtpLDZOxEro4eHDZ6NDLPQH4E98k1LJ3rN_pyMIuhxWbUn8O-P2xkxV1WBIY9k_Ih5db4_nI_rdyxod12qAd7-dqL1yw-thzl8dCtdm3JhSGiTSXeo6h984hADvpIBPYDXiXe-mMZOftq5ZDYHjU7rY_Iby6k-NoEmJb43a6UyBPbXXY80Yo_aOe57fxhWKMbr0M_aHzqkk73Lt3baB72uxAF7ZUvneH0thT6ZVluGkh6uKsDS3acyo4pq4hcg-kYhgGRpnwKOV2sQtEk6ucnUCGHY579m3SccwnhYKHP3Lntuq41l0sBCwrTmkxA9aTPqYmMWawgommKZVhYQaZGFapjqEMt1qFDwO8_eNDvZmwCAAA.H4sIAAAAAAAAAAEgAN__-GfYNe1shpTrWJb2tZJMkersYjCnu8mDxCe_Jlu0Kv3RUUigIAAAAA.4&access_type=offline",null,[],4,[],"GeneralOAuthFlow",null,[],1],10,[null,"159344105155-l3g18r35mrk7js66pin9lrdjs34k99k0.apps.googleusercontent.com",[],"!ChRPU0ZmTWNtRlFtMk53Q3RTc3FsLRIfODVrMks0RWtMcGtaWUlreWNoTjIyM1FjX1NUSHR4Zw∙AHkTZLMAAAAAZT_ljI_8t_BY9-CMm8S17TKM1CGD7VVH",null,null,null,null,null,null,null,"https://fireapp37222ab0-37222ab0-prod.auth.us-east-1.amazoncognito.com","S-1744716102:1698599948198764",0,null,null,null,null,[5,"77185425430.apps.googleusercontent.com",["https://www.google.com/accounts/OAuthLogin"],null,null,"CB274AA5-4769-423F-9F3B-A21B78604F48",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,5,null,null,[],null,null,null,null,[]],null,null,null,14,null,null,[],1,null,null,null,[[null,9315],[null,202],[null,204]],null,1,null,null,1],null,null,null,1,null,null,null,null,null,null,null,null,[],null,null,3]]
bgRequest: ["oauth-account-chooser","<ZKhqqPACAAZcS_mNfEuNbRwkfhaRD3T0ADQBEArZ1JsHFBXsZyq0f8RAbsi4dXeBrQSLSq9jPUOpaRJ-3sIgY6nNbZscTVwTqIUcGDUlzQAAAtOdAAAAKqcBB1YEasZNzHmRsf5ThdmksjFUlkq_qE6UC0g4IkNKa4_Sir9IRIonPWLvfWfRD7G69s_3c2GypxziUeui5cu3ea__xnacGQZQW-pJGo5ZeohtgrT_2nBxf8j730nofa-oZ3BggaC82G8wrPiS1pr9KfVH-k9C3zG3HhVbkC6WWvje2UAJfXKaRUQG164UN1NB918bTI_4zXecqsgDwcQ8Ucml7N1KWp50HhgNApudGRZPCi5B2SHwX8J0QEcRHuqdSLozoz0vLyd-FNSWYulBljfp7m9ctoNdUic56W0mRmj9RluH0rzt2dh0xXeUoscvviP-iv-nYJrME2AAHAHa2sQZwPYKyDdy3wPrrmg6yESTH1F26id7vuqXeYZR_qj8XkQHzahYzDI-O1PRrrRIHC5kdh34swpQgghE6qmbZvwCxGMacZkqcSV0IpstDFIpE-sJU-S4foBeA-eIEHmuZsJemNnJ_JYd0gM0O9Zs6V3w2U4rW7mhCnW7zBoxuglVJmHp2jRKYrK2puUWv6kRZPYDHFwn8uc7_noFXwRZBPEYePfAbExmvAKK5PnAiUWzbZm_6MNIHQ6LZ6hIDwHO8ZGZbu4NI1V9sSUqElWS0Z8dQLLR14wAiMW_bITMD9gvWcHKGqH41VBGLo7tlwBZgjfPwaJ-YjzpS_DNEIY3mVbXT81erHDCvmb432RaIp6gGs7VRU-FkkX96bdGsb3YFJTLbqm7zIBA_1mPJGlMVcdfyYx50kcLovIcealSrbV4HQTBb7mVPuhMzvIUKYTCU53baP55owO5e8QxeeDNDop1hIcfdMfgUs7dddsuPDLZTLiORWHLLeEkARxn2rTW3vb5RUO2VNzmX1AOEFbl1yFg1CvuN64yYHg_1XHL03h0bSkAU7EltQkAARoecdwpxraxOMZtD699-U9uRMJYXXbNIE44u2re66pgBQVJP3DQC3_BBEFsToQtcWxWwAPBcFl5Zk_x02NWt1VkndMkdUXJrmLZQBu5RetHhkpopr5dExCgNSs4zdsEtdfAe-H4HdRYs6bYO-5nbJEziF5eWc98JjNLP1UX-t6pqF1OB7NUjmSihtF2e_K3aP5IcYsb2eJqViFZ-efqDiP0Z50GXkpJXqrPOY8vhnNbrg-QrJjczyMVPg2GloP5DAPYX5Irvcg9XDkaLBcgaa6Exvzexd0OdwC3-fWyqQPcbqU101X3LgFyg2VUD6z0OlS8EE3oa2FKYIafMb_o4KddSpcxrqX2E4Smpw9FO36oeD0DbAAeHCwj9MaC78G5MdoNSMz1RTrLkNPY8o8FlQ3_VfEUpDsrZHWw0wfLOVMGrl1SePaST0fg6zpdn2pt2MrI_xNLo6LJgXMzS3McGvYg8Hpd33LbviSLVB87lHIYQql3VtWMAQ0WoqS2syhj710eg8c_v2ovEplxxIDi4I7-J9IGwB6_DjjStD-YvScDinMwEhB97HgOTc4bds7DEVe3BLd3rIytItkqo92_VXY_FPPU"]
at: AFoagUVxa_ZG-dCv6FdSu9NTwBS2tk424A:1698599948291
azt: AFoagUVxa_ZG-dCv6FdSu9NTwBS2tk424A:1698599948291
cookiesDisabled: false
deviceinfo: [null,null,null,[],null,"CA",null,null,null,"GeneralOAuthFlow",null,[null,"159344105155-l3g18r35mrk7js66pin9lrdjs34k99k0.apps.googleusercontent.com",[],"!ChRPU0ZmTWNtRlFtMk53Q3RTc3FsLRIfODVrMks0RWtMcGtaWUlreWNoTjIyM1FjX1NUSHR4Zw∙AHkTZLMAAAAAZT_ljI_8t_BY9-CMm8S17TKM1CGD7VVH",null,null,null,null,null,null,null,"https://fireapp37222ab0-37222ab0-prod.auth.us-east-1.amazoncognito.com","S-1744716102:1698599948198764",0,null,null,null,null,[5,"77185425430.apps.googleusercontent.com",["https://www.google.com/accounts/OAuthLogin"],null,null,"CB274AA5-4769-423F-9F3B-A21B78604F48",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,5,null,null,[],null,null,null,null,[]],null,null,null,14,null,null,[],1,null,null,null,[[null,9315],[null,202],[null,204]],null,1,null,null,1],null,null,null,null,1,null,0,1,"",null,null,1,1]
gmscoreversion: undefined
flowName: GeneralOAuthFlow
checkConnection: youtube:599:0
checkedDomains: youtube
(empty)
Ok so I removed the phone option.
more info
Hey @rush86999, thank you for the additional context and seeing if the removal of the phone
scope changed anything. If you refresh after the redirect from Google, does it show that there's a session? Are you using the default localStorage for cookies as well?
Hi @cwomack, if the default is localStorage then yes as I have not changed any settings for localStorage and whatever the default behavior is active. Here are more screenshots for Cookies. Not sure what to look for here.
Can you share what you see for the server side call for Auth.currentSession()
or possibly log the result? Trying to see what is in the session after that redirect from Google.
I'm having a hard time getting console logs but referrer I'm getting: /?state=lQwZcED9nd20vhJlnSWeMpLijoOnXsHz&error_description=RedirectUri%20is%20not%20registered%20with%20the%20client%20&error=invalid_request .
but I have: https://xxxx-prod.auth.us-east-1.amazoncognito.com/oauth2/idpresponse as redirect uri for the google client id
vercel is giving me a tough time getting server logs, nothing is coming out
hey @cwomack, just making sure you saw my notes. vercel is not loggin anything despite me using console.log everywhere but it may be due to redirect uri as I mentioned in my previous thread.
@rush86999, can you try calling Auth.currentAuthenticatedUser()
client side to validate that you are getting logged in properly, and we can isolate the problem to the SSR side of things (rather than issues with the federated sign in)?
Also want to add that v6 of Amplify was just released last week with improvements in many areas, including SSR and Next.js support. If you're able to, I'd highly recommend upgrading to the latest version. Regardless, want to help you figure this out on v5 if we can!
Here are the few errors. I just realized console logs were removed in production :)
{
"dt": "1700703811152",
"message": "START RequestId: 6adc4483-68c4-4ca3-b216-104de0fd3139 Version: $LATEST\n2023-11-23T01:43:31.193Z\t6adc4483-68c4-4ca3-b216-104de0fd3139\tINFO\tinside session\n2023-11-23T01:43:31.193Z\t6adc4483-68c4-4ca3-b216-104de0fd3139\tINFO\tNo current user unable to get logged in user sub\nEND RequestId: 6adc4483-68c4-4ca3-b216-104de0fd3139\nREPORT RequestId: 6adc4483-68c4-4ca3-b216-104de0fd3139\tDuration: 59.02 ms\tBilled Duration: 60 ms\tMemory Size: 1024 MB\tMax Memory Used: 351 MB\t\n",
"platform": "Vercel",
"vercel": {
"branch": "main",
"deployment_id": "dpl_4CTFGVriE33rCjDjdAeSiPgdC2iT",
"environment": "production",
"host": "atomic-mizsedztu-rush86999-s-team.vercel.app",
"id": "1700703811158283351012346449",
"path": "/",
"projectName": "atomic-app",
"project_id": "prj_S3MDTeMuduu1PYm6HZ3VuoIjLMst",
"proxy": {
"client_ip": "216.174.66.37",
"host": "app.atomiclife.app",
"lambdaRegion": "iad1",
"method": "GET",
"path": "/?state=5zqHO395sirgyrAryOzxHKxkVlvul5sY&error_description=RedirectUri%20is%20not%20registered%20with%20the%20client%20&error=invalid_request",
"pathType": "FUNC",
"referer": "https://accounts.google.com/",
"region": "cle1",
"scheme": "https",
"status_code": 307,
"timestamp": 1700703811152,
"user_agent": [
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"
],
"vercelCache": "MISS",
"vercelId": "xpfmk-1700703811152-01523706577f"
},
"request_id": "cle1::iad1::xpfmk-1700703811152-01523706577f",
"source": "lambda",
"source_type": "http",
"statusCode": 307
}
}
also server side edge functions
Error: No current user
how do i upgrade my app to v6?
just to add Auth.currentAuthenticatedUser() on client side can only be called inside user login component as the user gets redirected from other paths to login
Let me know if you need any other code to verify for the app to help with the diagnoses. I can also take a screenshot with blurred url to show I have cognito for the given client id just to show I followed instructions. Maybe I'm missing something else, I have no idea at this point.
HI @rush86999 following up here - I took a quick look at the app link you shared at this comment above and tested this out myself and an error that stood out to me was RedirectUri is not registered with the client
What this potentially means is that the redirect uri (redirect_uri: https://app.atomiclife.app//) that is being used here is not whitelisted in the Cognito UserPool client. Although I do see that you have it defined in your aws-exports
that you shared above, can you confirm that it is also present in Cognito?
You can check by going to Cognito console then:
@rush86999, wanted to check in again to see if you're still blocked by this or saw @nadetastic's comment above. Let us know if there's still help needed here!
I basically stopped working on this project. Sorry guys.
On Thursday, Mar 28, 2024, 7:55 PM, wrote:
@rush86999, wanted to check in again to see if you're still blocked by this or saw @nadetastic's comment above. Let us know if there's still help needed here! You are receiving this because you were mentioned.Message ID:
@rush86999, I'll close this issue based on the last comment, but feel free to comment back anytime if you get back to this project and still experience the issue.
Before opening, please confirm:
JavaScript Framework
Next.js
Amplify APIs
Authentication, GraphQL API
Amplify Categories
auth
Environment information
Describe the bug
User is not successfully logged in via Social Sign In on the web using Nextjs and ssr: true with aws amplify. There are no error messages just back to the login screen. There are no cookies set.
Expected behavior
Reproduction steps
Code Snippet
with session.ts file
Log output
aws-exports.js
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response