aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 819 forks source link

Multiple front ends hosting with the same SSO Cognito login #6282

Open robin22d opened 3 years ago

robin22d commented 3 years ago

I created an aws amplify back end as follows:

amplify init
amplify add auth
amplify push
amplify publish

Once this was done I created a front end and used the amplify pull command in the front end app

amplify pull --appId ************* --envName *******

I wanted to host this app so in the front end app I did

amplify init
amplify add hosting
amplify push
amplify publish

For the other front ends that i wanted to use the same backend on i created them in the same way and this works fine.

Is this the correct way to do this if so if i make changes to the cognito how would i get the updates to show on the front end?

Next when a user is logged into one how would I make is so they dont have to log into the app front ends?

jhockett commented 3 years ago

Hi @robin22d, check out the docs we have for multiple frontends.

robin22d commented 3 years ago

Hi yes I have had a look at the docs but I cannot see anything about hosting unless im missing something? Also do you know of any docs that would help me with when a user is logged into one how would I make is so they dont have to log into the app front ends?

jhockett commented 3 years ago

Is there something not covered in the hosting section? What are you trying to accomplish?

Also do you know of any docs that would help me with when a user is logged into one how would I make is so they dont have to log into the app front ends?

I don't fully understand the question. How would the user log in before accessing the FE?

robin22d commented 3 years ago

I don't fully understand the question. How would the user log in before accessing the FE?

I have two apps

The user has access to both apps and they log into app 1. Then when they go to app 2 they should already be logged in because both apps have the same back end. Its like login into gmail and then going to google docs and not having to log in again.

robin22d commented 3 years ago

Is there something not covered in the hosting section? What are you trying to accomplish?

Yes I have had a look that the hosting and wanted to know if the way that im doing it is correct.

jhockett commented 3 years ago

Hi @robin22d, thanks for clarifying! It sounds to me like you are looking for SSO (Single sign-on). Amplify does not currently have an out-of-the-box solution for SSO. I've marked this issue as a feature request.

adrianmatchbox commented 11 months ago

hi i am trying to replicate almost the same i have a django rest api, nextjs web application and another react web application. i am looking for a solution to keep authenticated through all my system applications. how i can handle it the most professional in production. Thanks