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