Skip to content

feat: make authSessionOpener configurable #14448

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bobbor
Copy link
Member

@bobbor bobbor commented Jun 26, 2025

Description of changes

This PR introduces a new option to the signInWithRedirect function.
The option is called authSessionOpener and allows customization on how to manage opening the authentication url for external identity providers.

Issue #, if available

#12895

Documentation PR
aws-amplify/docs#8376

Description of how you validated changes

In a sample app i have used external identity providers setup in my cognito configuration and overidden the URL handling using the new option, by opening a popup.

import { signInWithRedirect } from 'aws-amplify/auth';

await signInWithRedirect({
  provider: 'Google',
  options: {
    authSessionOpener: (url: string) => {
      window.open(url, "_blank", "popup")
    }
  }
});

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

Checklist for repo maintainers

  • Verify E2E tests for existing workflows are working as expected or add E2E tests for newly added workflows

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@bobbor bobbor requested review from osama-rizk and Simone319 June 26, 2025 13:50
@bobbor bobbor force-pushed the feature/12895/configure-authSessionOpener branch from 0f35eec to a13addd Compare June 27, 2025 10:35
@bobbor bobbor requested a review from a team as a code owner June 27, 2025 10:35
@bobbor bobbor force-pushed the feature/12895/configure-authSessionOpener branch from a13addd to c2697f7 Compare June 27, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant