okta / okta-aws-cli

A CLI for having Okta as the IdP for AWS CLI operations
https://github.com/okta/okta-aws-cli
Other
128 stars 34 forks source link

Return underlying Error if present in fetchWebSSO() #47

Closed emanor-okta closed 1 year ago

emanor-okta commented 1 year ago

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 commented 1 year ago

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