-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
clientMetadata is Not Passed to Custom Auth Triggers via Auth.signIn #12745
Comments
Hello, @emmavray and sorry to hear you're running into this issue. When the You might be able to implement a workaround where you call |
Closing this issue as we have not heard back from you. If you are still experiencing this, please feel free to reply back and provide any information previously requested and we'd be happy to re-open the issue. Thank you! |
Hi, this is something I'm looking into as well and wanted to know if there's any other workaround for it. I see you mentioned calling I tried using PreAuthentication trigger, but this trigger doesn't get called with a custom authentication. I know this is not an issue with library, and more of a limitation on cognito api, but I wonder if there's no other clean way to get this information to custom challenge triggers. |
Looking for this to work too.
Should the Custom authentication challenge Lambda triggers: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-challenge.html |
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Authentication
Amplify Categories
auth
Environment information
Describe the bug
When calling signIn with a authFlowType of
CUSTOM_WITHOUT_SRP
, theclientMetadata
provided in the options object is not passed to the custom auth triggers (custom-auth-create, custom-auth-define).My use case is passwordless login via a custom flow. I call signIn with
{ password: undefined }
and a custom authFlowType, and rely on the challenge to authenticate the user. However, multi-tenancy is a requirement of my application and I need some sort of custom metadata to determine which organization a user is signing into.Expected behavior
If clientMetadata is provided to the signIn request, it should be sent along to the trigger(s) involved in the sign in process.
This may be a bug or expected behavior in Cognito itself, but since Amplify provides the ability to send clientMetadata I'd expect it to be passed along. Also note that the Create Auth Challenge trigger docs specify that clientMetadata is available.
Reproduction steps
CUSTOM_WITHOUT_SRP
, and provide clientMetadataCode Snippet
Log output
Create Auth Challenge Lambda event (custom-auth-create), missing clientMetadata:
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: