Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

aws amplify get JWT TOKEN

// Gets current user session token after cognito sign in. 

Auth.currentSession().then(res=>{
  let accessToken = res.getAccessToken()
  let jwt = accessToken.getJwtToken()
  //You can print them to see the full objects
  console.log(`myAccessToken: ${JSON.stringify(accessToken)}`)
  console.log(`myJwt: ${jwt}`)
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #aws #amplify #JWT #TOKEN
ADD COMMENT
Topic
Name
6+1 =