-
Notifications
You must be signed in to change notification settings - Fork 822
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
[BUG] amplify import auth - imported cognito user pool - aws-exports.js missing oauth values #13578
Comments
Hey @bubai2000, was the cognito resource updated on the console after the resource was imported into amplify? |
Hi @ykethan, we tried re-importing but it still does not work. For now, we are hardcoding the Auth object in Amplify.configure. Thanks. |
Hi @ykethan, would like to add an observation here. We tried adding Google as a identity provider in the user pool and added that to the app client also. After that we ran the import auth. This time all the details were populated except Providers array, but "aws_cognito_social_providers" was populated with Google. We tried running signInWithRedirect with provider = {custom: 'Microsoft'} and it redirected it Microsoft OAuth landing page properly, also provider = {custom: ''} would open the congnito hosted UI. But then we tried removing the Google provider from the app client only and then re imported auth. This time again no details were populated except OAuth domain. So, as we understand we there is a pseudo-requirement as of now to set up at least one first class supported federated provider (Google, Facebook, Amazon, Apple) to properly import OAuth settings. Please try to emulate the same from your side and if it is current behavior we would recommend to solve this because there might be requirements to setup OAuth support without these first class supported OAuth providers. Thanks. |
Hey @bubai2000, thank you for the information. I was not able to reproduce the behaviour in my environment.
From comment: #10932 (comment) |
Hi @ykethan thank you for taking your valuable time to assess the problem. As I already said, if any of the providers between 'Facebook', 'Google', 'LoginWithAmazon', 'SignInWithApple' is present in cognito client(along with Microsoft), then OAuth config is imported properly, but if the client is only provided a provider that does not belong to the "supported provider" (e.g. only Microsoft) then the OAuth config is not getting imported properly from user pool. We currently provided the client both Google and Microsoft but on the redirectSignIn function we are providing provider name as Microsoft. This solved our problem as of now. But it would be great if we can remove dependency over these "supported provider". Thanks :) |
@bubai2000 thank you for the feedback and passing this to the team. |
|
How did you install the Amplify CLI?
No response
If applicable, what version of Node.js are you using?
20.11.0
Amplify CLI Version
12.10.1
What operating system are you using?
Windows 11
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No Manual Changes
Describe the bug
We tried setting up custom user pool for authentication which has a federated identity provider(Microsoft). When we ran amplify import auth, it only imported oauth domain name and missed other parameters like sign in URL, sign out URL, Provider name etc. As I understand written here https://docs.amplify.aws/javascript/build-a-backend/auth/import-existing-resources/ we need to have valid sign out URL in the hosted UI and also no client secret generated, we have all of those marks checked on our side. So, for now we have no way other than hardcoding the values in the json manually We also discovered an issue already reported years ago here #10932 but seems there was no further development regarding the same. Can we get some insights on how can we address this issue? Thanks!
![Screenshot 2024-02-06 121426](https://private-user-images.githubusercontent.com/69674084/302527712-40da3d66-fa9d-4557-93a5-327b658b1393.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTAyMDYsIm5iZiI6MTczOTAwOTkwNiwicGF0aCI6Ii82OTY3NDA4NC8zMDI1Mjc3MTItNDBkYTNkNjYtZmE5ZC00NTU3LTkzYTUtMzI3YjY1OGIxMzkzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDEwMTgyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU5MTVmNDZhNDIzYTY0NDNkNWM1ZTc1ZGNkN2RhYjlkMDMwNjc1NzkwZTFjZjhkMjkxZDdkZjg3Y2ZlZmI3MmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.r_pXX5NFUDygXsAsNPNjavgkzRMaH3bJUKLMqSlCYV0)
![Screenshot 2024-02-06 121536](https://private-user-images.githubusercontent.com/69674084/302527721-d83f8479-f0e0-426d-88df-02b281b587d2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTAyMDYsIm5iZiI6MTczOTAwOTkwNiwicGF0aCI6Ii82OTY3NDA4NC8zMDI1Mjc3MjEtZDgzZjg0NzktZjBlMC00MjZkLTg4ZGYtMDJiMjgxYjU4N2QyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDEwMTgyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI4MmRjN2YxYzc2Mzg3NTg3MDU0Zjc1OTk2MzJmMmM5YmZiNDVkM2FjM2QzYWUzMTBiMTU0YmUyYTZkMDZhNjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.B1mT0J6ABwxmGbLke8cfv0JBmVdyFC1fnCWiDXCTXes)
Expected behavior
aws-exports.js should contain all the oauth properties generated.
Reproduction steps
Similar to #10932
Project Identifier
c37ce404d7b0fcf7ea7086458f945ebf
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: