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 passing in empty token #754

Open
geowa4 opened this issue Apr 11, 2023 · 0 comments
Open

Error passing in empty token #754

geowa4 opened this issue Apr 11, 2023 · 0 comments

Comments

@geowa4
Copy link

geowa4 commented Apr 11, 2023

In osdctl, the code passes both the access token and the refresh token when calling connectionBuilder.Tokens. If in the code below, a long-lived offline access token is set as config.AccessToken and config.RefreshToken is set to an empty string (because it is not needed), the API will generate an error.

connectionBuilder.Tokens(config.AccessToken, config.RefreshToken)
Get \"https://api.stage.openshift.com/api/clusters_mgmt/v1/clusters?search=omitted&size=50\": can't get access token: invalid_grant: Invalid refresh token

There may not be a reason to pass in the refresh token since the user of osdctl could log in again to generate a new temporary access token or only use the long-lived offline access token so I will likely propose that change on that repository. However, I personally believe it would be beneficial for the API to ignore empty tokens and the SDK to ignore (or warn) when passed empty strings.

I am willing to make that change to the SDK, but I wanted to ask the maintainers first so let me know your thoughts. Thank you.

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