'Amazon Cognito - GetOpenIdTokenCommand clears basic authentication
We have a basic authentication on the apache server using the .htpassword file for lower dev and testing environments. The issue we have is when we call GetOpenIdTokenCommand to get a new OpenID token, it seems to clear something causing the previously valid basic auth to prompt for user and password over again.
Not really code to post, its just a basic post, but when this call is made, the prompt comes back up over and over and you can no longer authenticate the basic auth. If you hit cancel, the response comes back and it has a new token that is stored so you can refresh and it no longer tries to get a new one.
const command = new GetOpenIdTokenCommand({
IdentityId: 'ITENTITY',
});
## AFTER CALLING THIS, IT PROMPTS FOR BASIC AUTH OVER AND OVER
## AGAIN AND DOES NOT HIT THE THEN FUNCTION.
## AFTER CANCELING THE BASIC AUTH REQUEST, THE THEN FUNCTION IS HIT AND SETS THE TOKEN
return this.client.send(command).then(response => {
localStorage.setItem('access_token', response.Token);
this.token = response.Token
return this.token;
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
