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

136
Views
Use refreshtoken from subdomain A to authenticate for subdomain B in Cognito

We are using Cognito via Amplify/Auth to handle our signup. After the signup is done (on signup.foo.com) we redirect the user to the dashboard (on app.foo.com). Using localstorage, the session is locked to the domainname of signup.foo.com and not accessible at signup.foo.com.

We used cookieStorage with a *.foo.com domain, which worked, but we are having issues with the cookies disappearing on our mobile Webview solution, so I am looking at going back to the localstorage solution.

However, it seems to be impossible to carry over a session from one subdomain to the second, even if we use the same app client in Cognito.

I was able to get a new access token using the refresh token of the signup session using aws cognito-idp admin-initiate-auth via the command line, but I can't manually inject the refreshToken or accessToken in the localstorage with the correct key name. The Auth module doesn't accept it, and it probably is because the domain is hashed into the refreshtoken.

Is there an official way to, either via Node and a valid refresh or JWT token, to get a new token that can be injected into subdomain B?

Cheers,

Mattijs

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!