Hi,
I am setting up the frontend web site (with AngularJS v1.2.14) to interact with a Web API using an Authorization Bearer Token.
I’ve set up OktaAuth (okta/okta-auth-js) like so:
var authClient = new OktaAuth({
url: '<okta_server>',
clientId: '<client_secrete>',
redirectUri:'<redirect_url>'
});
then calling authClient.token.getWithoutPrompt, I get the token successfully, and save it to tokenManager:
authClient.tokenManager.add('tokenKey', token);
However, immediately after, trying to get the same token, I can’t retrieve it from tokenManager, like so:
authClient.tokenManager.get('tokenKey');
I get no errors in console. I can’t seem to figure out what’s going on here.
Does anyone have any idea why this is not working?
Thanks.
Regards,
Nuno