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

Error when using profile argument in v2.1.1 #194

Closed
joshgch opened this issue Feb 26, 2024 · 1 comment · Fixed by #196 or #197
Closed

Error when using profile argument in v2.1.1 #194

joshgch opened this issue Feb 26, 2024 · 1 comment · Fixed by #196 or #197

Comments

@joshgch
Copy link

joshgch commented Feb 26, 2024

After upgrading to v2.1.1, the okta-aws-cli client errors when a profile is specified with either -p or --profile.

okta-aws-cli \
    -i=arn:aws:iam::1234567890:saml-provider/provider \
    -r=arn:aws:iam::1234567890:role/Rolename \
    -p=profile-name \
    -a=abcdefgh \
    -b=true \
    -c=abcdefgh \
    -e=true \
    -f=aws-credentials \
    -o=abcd.okta.com \
    -s=21600 \
    -z=true

Error: Post "https:///oauth2/v1/device/authorize": http: no Host in request URL

Reverting to 2.1.0 fixes this issue.

MatthewJohn added a commit to MatthewJohn/okta-aws-cli that referenced this issue Feb 27, 2024
…an AWS profile is not present in the config.

viper.Get() returns an empty string when an AWS profile exists in the config, but has not been set.
viper.Get() returns nil when the AWS profile does not exist in the config or the config file does not exist.
viper.IsSet() returns will return false when the config/profile does not exist, but always returns true when the profile exists (irelevant of whether the actual key is defined).
Combining these two means that:
 * When a config file does not exist or profile is not present in the config, IsSet will return false and the original key is returned.
 * When a config file does exist and the profile exists, but the config key does not exist, Get will return an empty string and the key is returned.
 * When a config file does exist, the profile exists and the key exists, IsSet returns true, Get returns non-empty string and the '<profile>.<config>' key is returned.

Fixes okta#194

Addresses issue in okta#192
@MatthewJohn
Copy link
Contributor

Hi @joshgch ,

I'm really sorry about this problem - I've create a PR to address this problem: #196

Apologies
Matt

@monde monde mentioned this issue Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants