You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constcognitoUser=newCognitoUser(userData);cognitoUser.authenticateUser(authenticationDetails,{onSuccess: (result)=>{console.log('access token + '+result.getAccessToken().getJwtToken());Config.credentials=newCognitoIdentityCredentials({IdentityPoolId: appConfig.IdentityPoolId,Logins: {[`cognito-idp.${appConfig.region}.amazonaws.com/${appConfig.UserPoolId}`]: result.getIdToken().getJwtToken()}});alert('Success');console.log(Config.credentials);//now user is logged in - can get session herecognitoUser.getSession((error,result)=>{if(error){console.log(error);}else{console.log(result);}});},onFailure: (err)=>{alert(err);},});
I ran the app.js from the example locally. Cognito returns the access token. However, when console logging Config.credentials, I got the following:
CognitoIdentityCredentials {expired: true, expireTime: null, accessKeyId: undefined, sessionToken: undefined, params: Object…}
accessKeyId:undefined
data:null
expireTime:null
expired:true
params:Object
sessionToken:undefined
_clientConfig:Object
_identityId:null
identityId:(...)
secretAccessKey:undefined
get identityId:function get()
set identityId:function set(identityId)
proto:Credentials
How do I get a valid session when an user login ?
The text was updated successfully, but these errors were encountered: