Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

280
Views
How to decrypt the verification code from cognito?

I got the code like this in request codeParameter:"{####}" and I want to store it in database decrypted.

const { plaintext, messageHeader } = await decrypt(
      keyring,
      b64.toByteArray(codeParameter),
    );
    console.log(plaintext, messageHeader);

That's the request

{
  version: '1',
  region: 'eu-west-1',
  userPoolId: 'xxxxxxx',
  userName: 'xxxxxxxx',
  callerContext: {
    awsSdkVersion: 'aws-sdk-unknown-unknown',
    clientId: 'xxxxxxxx'
  },
  triggerSource: 'CustomMessage_SignUp',
  request: {
    userAttributes: {
      sub: 'xxxxxxx',
      'cognito:email_alias': 'xxxxxxx',
      email_verified: 'false',
      'cognito:user_status': 'UNCONFIRMED',
      email: 'xxxxxxx'
    },
    codeParameter: '{####}',
    linkParameter: '{##Click Here##}',
    usernameParameter: null
  },
  response: { smsMessage: null, emailMessage: null, emailSubject: null }
}

From what can I see it's named code on AWS DOC and not codeParameter..

https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-email-sender.html

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!