question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use existing Cognito User pool with amplify auth

See original GitHub issue

Hi, I’m working on an android project with amplify. I find it very powerful but it also hides lot of complexity. So…

Is it possible to use amplify with an existing Cognito User pool I already configured.

amplify add auth (I would like to specify my own user pool and not create a new one)

This is already possible for appsync amplify add codegen --apiId XXXXXXXXXXXXXXXXXXXXXXXX

More generally I would like to swith my configuration from dev to prod env

Thanks,

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:64
  • Comments:71 (15 by maintainers)

github_iconTop GitHub Comments

44reactions
kaustavghosh06commented, Feb 5, 2019

Hey guys, if you want to use an already configured user pool, you can manually add it to your client-side code. For more details, look at - https://aws-amplify.github.io/docs/js/authentication#manual-setup

Amplify CLI uses Cloudformation to deploy and manage resources and unfortunately, Cloudformation doesn’t allow you to manage existing resources, so you won’t be able to manage an already existing resource using the Amplify CLI for now.

26reactions
dseekercommented, Sep 16, 2019

in my use case, we’re tying do modularize the project so that any new amplify projects could use the same Cognito pool that’s already setup. example, we have 2 API endpoints (userdata and payment), we’d like development of those APIs to be independent (separate teams, separate repository), but have them still share the same Cognito to allow all the @auth transform directives to work in the GQL schema with this existing AUTH endepoint

ideally we’d be able to do

amplify add auth --poolARN arn:aws:cognito-idp:eu-west-1:500880489372:userpool/eu-west-1_4DFTecsHs

the current amplify project does not need to load all the configuration and redeploy the AUTH component, but can still use this configuration to automatically set the Amplify API with relevant information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use an existing Cognito User Pool and Identity Pool
Import existing Amazon Cognito resources into your Amplify project. Get started by running amplify import auth command to search for & import an...
Read more >
Use existing Cognito User Pools & Identity Pools for your ...
Just run the “amplify import auth” command and Amplify CLI will automatically configure all your Amplify-provisioned resources (GraphQL APIs, S3 ...
Read more >
Amplify import auth (existing cognito user Pool) - issue ...
We deployed our application with amplify, and it works well with a new cognito user pool. We need to use an existing cognito...
Read more >
Recreating an existing Cognito User Pool in AWS Amplify
Cognito User Pools cannot be modified. AWS Amplify does not support custom fields yet. Hence, the solution I came to was to run...
Read more >
Authentication in React with AWS Cognito and Amplify
In this tutorial we will be covering how to add authentication to your future (and even current) React apps using AWS Cognito user...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found