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

Creating multiple Cognito App clients to distinguish and separate settings and urls between apps (Web, iOS, etc.) #12932

Closed
2 tasks done
maziarzamani opened this issue Jul 11, 2023 · 9 comments
Labels
auth Issues tied to the auth category of the CLI pending-triage Issue is pending triage

Comments

@maziarzamani
Copy link

Is this related to a new or existing framework?

No response

Is this related to a new or existing API?

Authentication

Is this related to another service?

Cognito

Describe the feature you'd like to request

Currently it only seems to be possible to create one Cognito App client which is utilized for everything. This unfortunately makes no sense as settings are usually different on web vs. iOS/android apps. It would make sense to be able to create separate clients that can be utilized in the project.

Describe the solution you'd like

The ability to create separate clients which then can be selected in apps as well as web frameworks.

Describe alternatives you've considered

Overriding auth and creating the clients manually, however this will break the aws-export file which gives a lot of convenience.

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change
@maziarzamani maziarzamani added the pending-triage Issue is pending triage label Jul 11, 2023
@maziarzamani
Copy link
Author

Seems like there is already a similar issue: #10871

@nadetastic nadetastic added the auth Issues tied to the auth category of the CLI label Jul 11, 2023
@nadetastic nadetastic self-assigned this Jul 11, 2023
@nadetastic
Copy link

Hi @maziarzamani im going to transfer this issue over to the CLI repo for better assistance. Thanks!

@nadetastic nadetastic transferred this issue from aws-amplify/amplify-js Jul 11, 2023
@nadetastic nadetastic removed their assignment Jul 11, 2023
@nadetastic nadetastic removed the auth Issues tied to the auth category of the CLI label Jul 11, 2023
@josefaidt
Copy link
Contributor

Hey @maziarzamani 👋 thanks for raising this! By default, when creating auth via amplify add auth we will create two separate Cognito User Pool Clients: one for web and one for mobile. For example, in a JavaScript/React project we see the following client ID in aws-exports.js

"aws_user_pools_web_client_id": "3rjo997hn0pn36fqmrf4iqeqp1",

And if I run amplify configure project to change over to an Android project we see the following generated in amplifyconfiguration.json

"CognitoUserPool": {
        "Default": {
            "PoolId": "us-east-1_6UtcQOHXR",
            "AppClientId": "6lggo8h4eifbik48v2jda9uttd",
            "Region": "us-east-1"
        }
    },

@josefaidt josefaidt added auth Issues tied to the auth category of the CLI pending-response Issue is pending response from the issue author labels Jul 11, 2023
@maziarzamani
Copy link
Author

Hey @maziarzamani 👋 thanks for raising this! By default, when creating auth via amplify add auth we will create two separate Cognito User Pool Clients: one for web and one for mobile. For example, in a JavaScript/React project we see the following client ID in aws-exports.js

"aws_user_pools_web_client_id": "3rjo997hn0pn36fqmrf4iqeqp1",

And if I run amplify configure project to change over to an Android project we see the following generated in amplifyconfiguration.json

"CognitoUserPool": {
        "Default": {
            "PoolId": "us-east-1_6UtcQOHXR",
            "AppClientId": "6lggo8h4eifbik48v2jda9uttd",
            "Region": "us-east-1"
        }
    },

Makes sense! However can I have an Android as well as iOS, and web individually setup, or will it always create two app clients regardless of the amount of apps I may have?

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

However can I have an Android as well as iOS, and web individually setup, or will it always create two app clients regardless of the amount of apps I may have?

It will always create the two clients, however you can create additional clients using auth overrides. The caveat being the new client's ID will not be surfaced in the amplifyconfiguration files

@josefaidt josefaidt added the pending-response Issue is pending response from the issue author label Jul 12, 2023
@josefaidt
Copy link
Contributor

Hey @maziarzamani are you still experiencing this? Were you able to find a solution?

@maziarzamani
Copy link
Author

I gave up for now, and just wen't ahead with those two automatically generated client, so no solution for now..

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Aug 14, 2023
@ykethan
Copy link
Contributor

ykethan commented Aug 16, 2023

@maziarzamani closing the issue, please feel free in reaching out to us if you require any additional assistance.

@ykethan ykethan closed this as not planned Won't fix, can't repro, duplicate, stale Aug 16, 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 pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

4 participants