Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending wrong actor_token when switching okta domain fastly. #264

Open
DingGGu opened this issue Jan 15, 2025 · 1 comment
Open

Sending wrong actor_token when switching okta domain fastly. #264

DingGGu opened this issue Jan 15, 2025 · 1 comment

Comments

@DingGGu
Copy link

DingGGu commented Jan 15, 2025

Hi there,

I am using okta-aws-cli to configure terraform and aws cli, command to receive AWS Credentials.

Example command for login aws-cli:

$ okta-aws-cli web  --org-domain "a.okta.com" --oidc-client-id "??" -- aws-acct-fed-app-id "??" --aws-iam-idp "??" --open-browser
$ okta-aws-cli web  --org-domain "b.okta.com" --oidc-client-id "??" -- aws-acct-fed-app-id "??" --aws-iam-idp "??" --open-browser

When login multiple times quickly, and if the org-domain is different, an error occurs that the subject_token is Invalid.

So I checked it using the okta-aws-cli -d -g web option,

At the POST /oauth2/v1/token step, I was able to confirm that the iss value and aud value of the jwt token in the actor_token parameter are the previous domain.

It seems that the actor_token is cached somewhere.

Expected behavior:
okta-aws-cli web should work

iss and aud values:
attempt1) a.okta.com
attempt2) b.okta.com

Current status:

Error: Okta API returned an error: 'subject_token' is invalid.
An error occurred

iss and aud values:
attempt1) a.okta.com
attempt2) a.okta.com

@DingGGu
Copy link
Author

DingGGu commented Jan 15, 2025

Find out solutions:

Delete file a ~/.okta/awscli-access-token.json

okta-aws-cli option:
Cache Okta access token at $HOME/.okta/awscli-access-token.json to reduce need to open device authorization URL

Need to improvement for caching access token by each okta domain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant