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

Ability to use https redirectSignOutUrls when using amplify v6 #12890

Open
1 of 2 tasks
cranberyxl opened this issue Jan 24, 2024 · 10 comments · May be fixed by #12969
Open
1 of 2 tasks

Ability to use https redirectSignOutUrls when using amplify v6 #12890

cranberyxl opened this issue Jan 24, 2024 · 10 comments · May be fixed by #12969
Assignees
Labels
Auth Related to Auth components/category bug Something isn't working React Native React Native related issue VP Version parity issues between v5 and v6

Comments

@cranberyxl
Copy link

Is this related to a new or existing framework?

React Native

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

When using a federated SSO client we need to be able to signout of the upstream provider inside of the webview. TO do this we want to be able to call something like https://upstreamSSOProvider.com/logout?post_logout_redirect_uri=mobile%3A%2F%2F, however https urls are rejected on react native. The upstream logout prodivder will ultimately redirect back to the mobile:// url as the cognito logout would do.

Describe the solution you'd like

The ability to override the invalidRedirectException thrown here, using the provided signout uri

Describe alternatives you've considered

  1. Stay on v5 where we can use our own webview implementation
  2. Find a way to use the rtn-browser directly to do this

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
@cranberyxl cranberyxl added the pending-triage Issue is pending triage label Jan 24, 2024
@nadetastic nadetastic added the Auth Related to Auth components/category label Jan 24, 2024
@cwomack cwomack added the React Native React Native related issue label Jan 24, 2024
@cwomack cwomack self-assigned this Jan 24, 2024
@cwomack cwomack added investigating This issue is being investigated and removed pending-triage Issue is pending triage labels Jan 24, 2024
@cwomack
Copy link
Contributor

cwomack commented Jan 24, 2024

Hello, @cranberyxl 👋 and thank you for opening this issue. Can you confirm that you're only seeing this issue when you upgraded to v6, and if you downgrade back to v.5x that the problem goes away?

@cwomack cwomack added the pending-response Issue is pending response from the issue requestor label Jan 24, 2024
@cranberyxl
Copy link
Author

The problem goes away in v5 only because we can use a custom webview solution like react-native-inappbrowser-reborn and as far as I can tell, the no https restriction was added in v6

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue requestor label Jan 24, 2024
@cwomack
Copy link
Contributor

cwomack commented Jan 29, 2024

@cranberyxl, thank you for the confirmation. I'll mark this as a bug then and review this with the team internally. We'll comment back with updates or further questions as we make progress.

@cwomack cwomack added bug Something isn't working and removed investigating This issue is being investigated labels Jan 29, 2024
@elorzafe elorzafe linked a pull request Feb 7, 2024 that will close this issue
4 tasks
@elorzafe
Copy link
Contributor

cranberyxl when you configured SSO provider on Amazon Cognito you dont need to go to the sign out endpoint manually, you can configure that directly on Cognito. Have you tried that?

More information on Cognito docs

@cranberyxl
Copy link
Author

@elorzafe The nature of our auth setup does not allow for this. We need the ability to use different redirect urls in different scenarios on the react-native experience just like we would be able to do in a web context.

@josefaidt
Copy link
Contributor

josefaidt commented Feb 15, 2024

Hey @cranberyxl 👋 what is the use case you're looking to address where the Cognito-initiated IdP signout is not sufficient? Is there a particular solution you have in mind to address this?

@cranberyxl
Copy link
Author

cranberyxl commented Feb 20, 2024

@josefaidt Our authentication situation involes an upstream OIDC connection that then provides the SSO experience.

Cognito --OIDC--> Upstream IdP --SAML/OIDC--> IdP providing SSO experience

I have not been able to get the upstream provider to logout without directly calling its logout url as part of the logout redirect, which then properly handles the auth cookies in the browser session.

I don't understand why I can't provide a completely valid https signOut url to the new amplify library when using react native. I'm also very confused as to why there would be an array of signOut urls when only one of them can be redirected to after cognito signs out.

@josefaidt
Copy link
Contributor

Ah thanks for the clarification @cranberyxl ! The OIDC provider is a great callout, as unfortunately the "single logout (SLO)" feature is only supported for SAML IdP's.

When a user signs in with third-party identity providers (IdPs), there's an extra step to perform. If a user signs in using one of the third-party IdPs, then visiting the logout endpoint clears the "cognito" cookie from the browser. However, the IdP can still have an active session. Consider the following information when you're clearing out the user's IdP session:

  • Amazon Cognito supports the single logout (SLO) feature for Security Assertion Markup Language version 2.0 (SAML 2.0) IdPs with HTTP POST Binding. If your provider accepts HTTP POST Binding on its SLO endpoint, then consider implementing SLO for SAML IdPs. If a user visits the logout endpoint with SLO turned on, then Amazon Cognito sends a signed logout request to the SAML IdP. Then, the SAML IdP clears the IdP session.
  • For social and OpenID Connect (OIDC) IdPs, you must create a custom workflow to clear the IdP session from the browser.

https://repost.aws/knowledge-center/cognito-logout-endpoint-globalsignoutapi

From the information above this falls into the "custom workflow" callout for OIDC IdP's to initiate the upstream signout.

I don't understand why I can't provide a completely valid https signOut url to the new amplify library when using react native. I'm also very confused as to why there would be an array of signOut urls when only one of them can be redirected to after cognito signs out.

This is a valid callout! We do allow configuring multiple signin/signout redirect URI's, however it is not surfaced to the client API as you've experienced. Although, this would be desirable for custom flows like you have where you're attempting to initiate signout for your upstream OIDC provider.

Let me chat with the team and follow-up with next steps 🙂

@nadetastic nadetastic added the VP Version parity issues between v5 and v6 label Feb 22, 2024
@josefaidt
Copy link
Contributor

Hey @cranberyxl 👋 to provide an update here we'll keep this issue labeled as-is as we work towards a solution to enable this in favor of supporting upstream signout for oidc flows.

@ryanweaver718
Copy link

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auth Related to Auth components/category bug Something isn't working React Native React Native related issue VP Version parity issues between v5 and v6
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants