ClientMetadata not passing to Cognito Trigger, with `Auth.signIn({... , validationData: {foo: 'bar'}})`
See original GitHub issueDescribe the bug
ClientMetadata not passing to Cognito Trigger, when using Amplify Custom Ui components and Auth.signIn()
Auth.signIn({... , validationData: {foo: 'bar'}})
, even with static preconfigured ClientMetadata,
Auth.configure({ authenticationFlowType: 'CUSTOM_AUTH', clientMetadata: {foo: 'bar'} })
or
Amplify.configure({ Auth: { authenticationFlowType: 'CUSTOM_AUTH', clientMetadata: {foo: 'bar'} } })
To Reproduce Steps to reproduce the behavior:
browser js code
Auth.configure({ clientMetadata: {foo: 'bar'} })
await Auth.signIn({ username: 'someuser', validationData: {xyz: 'abc'} })
lambda trigger
exports.handler = (event, ctx, callback) => {
console.log(event)
}
Expected behavior
Expect to see log of foo
, xyz
ClientMetadata in lambda cloudwatch logs , this are missing.
Additional context Amplify versions
- “aws-amplify”: “^3.1.1”,
- “aws-amplify-react”: “^4.2.2”,
You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = ‘DEBUG’; in your app.
browser_debug_log
cloudwatch log*
2020-09-04T22:19:05.727Z **** INFO {
version: '1',
region: 'us-west-2',
userPoolId: '****',
userName: '****',
callerContext: {
awsSdkVersion: 'aws-sdk-unknown-unknown',
clientId: '****'
},
triggerSource: 'DefineAuthChallenge_Authentication',
request: {
userAttributes: {
sub: '****',
email_verified: 'true',
'cognito:user_status': 'CONFIRMED',
'cognito:email_alias': '****',
given_name: '****',
family_name: '****',
email: '****'
},
session: [],
userNotFound: false
},
response: { challengeName: null, issueTokens: null, failAuthentication: null }
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:21
- Comments:32 (5 by maintainers)
Top GitHub Comments
@sammartinez, thanks for getting back to us on this issue. Do you have any idea when this may be resolved? We are in the progress of rewriting our authentication backend, but if this is resolved within a reasonable timeframe we will skip that rewrite.
The main thing for us is that the clientMetadata should be made available in all the available Cognito lambda triggers. It is also important that if the clientMetadata has been set during Auth.signIn in the js client, it should be set automatically if the Auth framework does an automatic refresh.
Amplify JS library has this problem solved. Latest version is sending
ClientMetadata
for token refresh.We are expecting now from Cognito service to fix the problem on the server side.
Please +1 on one of this issues on AWS Forums to keep more feedback for this internally https://forums.aws.amazon.com/thread.jspa?messageID=946444󧄌 https://forums.aws.amazon.com/thread.jspa?messageID=910021󞋅
or feel free to create an issue on AWS Forums as well