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

Return underlying Error if present in fetchWebSSO() #47

Merged
merged 8 commits into from
Jan 24, 2023

Conversation

emanor-okta
Copy link
Contributor

As is when running the aws cli and an error is returned during the fetchWebSSO() call only the http error code is returned,
Error: fetching SSO web token received API response "400 Bad Request"

Update the function to check if an error is returned and if so add it to the error message to be displayed,

Incorrectly configured app in Web SSO field of the AWS Federation Application now returns,

Open the following URL to begin Okta device authorization for the AWS CLI

https://emanor-oie.oktapreview.com/activate?user_code=VQPWSLVD

Error: fetching SSO web token received API response "400 Bad Request"
error: "invalid_grant", description: "The target audience app must be configured to allow the client to request a 'web_sso_token'."

If the AWS Federation App has a more restrictive authentication policy which fails now returns,

Open the following URL to begin Okta device authorization for the AWS CLI

https://emanor-oie.oktapreview.com/activate?user_code=NMRPRLQD

Error: fetching SSO web token received API response "400 Bad Request"
error: "invalid_grant", description: "The application's assurance requirements are not met by the 'subject_token'."

@monde
Copy link
Collaborator

monde commented Jan 23, 2023

@emanor-okta I like it. I also added in verbose http debugging with httputil, fwiw, when in debug mode.

@monde monde self-requested a review January 23, 2023 18:12
Copy link
Collaborator

@monde monde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @emanor-okta

internal/sessiontoken/sessiontoken.go Outdated Show resolved Hide resolved
@monde monde mentioned this pull request Jan 24, 2023
@monde monde merged commit b2ea7fd into okta:master Jan 24, 2023
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

Successfully merging this pull request may close these issues.

2 participants