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

Auth with token has reduced privilidges #94

Open
cobookman opened this issue Mar 5, 2024 · 0 comments
Open

Auth with token has reduced privilidges #94

cobookman opened this issue Mar 5, 2024 · 0 comments

Comments

@cobookman
Copy link

cobookman commented Mar 5, 2024

The usage of basic auth with API Key/user-tokens at least in my Service Sonar enterprise instance has reduced privileges even when associated to 'super admin' users. I noticed that by changing auth from Basic Auth to instead by Authorization Bearer Token headers, these auth issues went away.

Any issues if we change how user-tokens are authed from being Basic Auth to be instead bearer-token header.

if token:
_auth = HTTPBasicAuth(token, "")

Involves slight change to the codebase to be instead, something like:

if token:
    _session.headers.update({'Authorization': f'Bearer {token}'})
elif username and password:
    _session.auth = HTTPBasicAuth(username, password)
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