Skip to content
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

amplify import auth does not generate oauth block properly #12979

Closed
2 tasks done
PAKalucki opened this issue Jul 20, 2023 · 3 comments
Closed
2 tasks done

amplify import auth does not generate oauth block properly #12979

PAKalucki opened this issue Jul 20, 2023 · 3 comments
Labels
auth Issues tied to the auth category of the CLI import Issues related to importing resources into an Amplify project pending-triage Issue is pending triage

Comments

@PAKalucki
Copy link

PAKalucki commented Jul 20, 2023

How did you install the Amplify CLI?

curl

If applicable, what version of Node.js are you using?

No response

Amplify CLI Version

12.1.1

What operating system are you using?

Ubuntu

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

no

Describe the bug

When running amplify import auth on existing Cognito pool with federated Google identity provider it generates only partial oauth block:

const awsmobile = {
    "aws_project_region": "eu-west-2",
    "aws_cognito_identity_pool_id": "eu-west-2:xxx",
    "aws_cognito_region": "eu-west-2",
    "aws_user_pools_id": "eu-west-xxx",
    "aws_user_pools_web_client_id": "xxx",
    "oauth": {
        "domain": "xxx.eu-west-2.amazoncognito.com"
    },
    "federationTarget": "COGNITO_IDENTITY_POOLS",
    "aws_cognito_username_attributes": [
        "EMAIL"
    ],
    "aws_cognito_social_providers": [
        "GOOGLE"
    ],
    "aws_cognito_signup_attributes": [],
    "aws_cognito_mfa_configuration": "OFF",
    "aws_cognito_mfa_types": [],
    "aws_cognito_password_protection_settings": {
        "passwordPolicyMinLength": 8,
        "passwordPolicyCharacters": []
    },
    "aws_cognito_verification_mechanisms": [
        "EMAIL"
    ]
};

oauth block is missing scope, redirectSignIn, redirectSignOut and responseType

Expected behavior

Import auth should generate valid oauth configuration

Reproduction steps

  1. Create AWS cognito pool with federated identity provider only, remove COGNITO provider from app client
  2. Run amplify import auth

Project Identifier

33739d596e34c742587a51ad8b9170f4

Log output

No response

Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@PAKalucki PAKalucki added the pending-triage Issue is pending triage label Jul 20, 2023
@ykethan
Copy link
Member

ykethan commented Jul 20, 2023

Hey @PAKalucki, thank you for reaching out. Could you let us know if the Cognito user pool App client has a Allowed sign-out URLs defined? if the sign-out URL was not defined could you add the sign-out URL, then reimport the Cognito user pool and push.
I was able to reproduce this behaviour when the Cognito user pool App client was configured without a sign-out URL.

If the sign-out URL was defined, could you provide some additional information on the configurations applied on the Cognito user pool?

@ykethan ykethan added auth Issues tied to the auth category of the CLI pending-response Issue is pending response from the issue author import Issues related to importing resources into an Amplify project labels Jul 20, 2023
@PAKalucki
Copy link
Author

@ykethan After defining the sign-out URL, the oauth is populated correctly, thank you.

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Jul 21, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues tied to the auth category of the CLI import Issues related to importing resources into an Amplify project pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

2 participants