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

feat(Auth): Allow sending login_hint, lang and nonce on signInWithRedirects #14089

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

Conversation

Alevale
Copy link

@Alevale Alevale commented Dec 18, 2024

Description of changes

This adds support for the login_hint, lang and nonce parameters, which are supported by cognito as of the official documentation https://docs.aws.amazon.com/cognito/latest/developerguide/authorization-endpoint.html

The way to pass them is by adding them as extra options under the input parameters on the signInWithRedirect function

await signInWithRedirect({
	provider: 'Google',
	options: {
		loginHint: '[email protected]',
		lang: 'en',
		nonce: '88388838883',
	},
});

Issue #, if available

Adding login_hint would fix #8951
Possible fix by adding nonce #4998
Support lang attribute #14040

Description of how you validated changes

  • I added a unit tests to verify that when the parameters are passed they end up in the URL
  • I created a sample app to test the changes and verified that they are working against 2 providers, Okta and Azure.

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
  • New source file paths included in this PR have been added to CODEOWNERS, if appropriate

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

@Alevale Alevale force-pushed the feat/amplify-auth-#8951-allow-additional-parameters branch 2 times, most recently from aea008c to 4e14f62 Compare December 18, 2024 23:02
@Alevale Alevale changed the title feat<Auth>: Allow sending login_hint, lang and nonce on signInWithRedirects feat(Auth): Allow sending login_hint, lang and nonce on signInWithRedirects Dec 19, 2024
@Alevale Alevale force-pushed the feat/amplify-auth-#8951-allow-additional-parameters branch from 4e14f62 to 0b43c44 Compare December 19, 2024 10:25
@HuiSF
Copy link
Member

HuiSF commented Dec 19, 2024

Thanks for opening the PR @Alevale and adding the tests for it. We will review the proposed change internally 👍

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.

Support Google login_hint for auth [react]
2 participants