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

Basic-auth doesn't work #196

Closed
bkabrda opened this issue Aug 6, 2015 · 3 comments
Closed

Basic-auth doesn't work #196

bkabrda opened this issue Aug 6, 2015 · 3 comments
Assignees

Comments

@bkabrda
Copy link

bkabrda commented Aug 6, 2015

When running osbs-client API functions from atomic-reactor plugins, I'm getting tracebacks like the one that @twaugh posted at #195 (comment)
It seems that the problem is that osbs-client doesn't send proper X-CSRF-Token. For example:

# osbs is instance of osbs.api.OSBS
>>> r = osbs.os._get('https://192.168.122.121:8443/oauth/authorize?response_type=token&client_id=openshift-challenging-client', with_auth=False, allow_redirects=False)
>>> r.headers
{'date': 'Thu, 06 Aug 2015 08:18:04 GMT', 'content-length': '77', 'warning': '199 OpenShift "A non-empty X-CSRF-Token header is required to receive basic-auth challenges"', 'content-type': 'text/plain; charset=utf-8'}

The _get call reproduces what osbs-client does at https://github.com/projectatomic/osbs-client/blob/master/osbs/core.py#L110

@bkabrda
Copy link
Author

bkabrda commented Aug 6, 2015

One more note: the configuration used as input for OSBS constructor must specify use_auth=True for this to occur. Something like:

>>> oc = osbs.conf.Configuration(conf_file=None, openshift_uri="https://192.168.122.121:8443", use_auth=True, verify_ssl=False)
>>> osbs=osbs.api.OSBS(oc, oc)

@twaugh
Copy link
Member

twaugh commented Aug 6, 2015

See analysis in #195 (comment).

@twaugh
Copy link
Member

twaugh commented Aug 6, 2015

@TomasTomecek mentioned that service accounts might be the right approach for plugins to authenticate.

@twaugh twaugh closed this as completed in fd80609 Aug 7, 2015
bkabrda pushed a commit that referenced this issue Aug 7, 2015
Use value of use_auth for metadata_plugin_use_auth (fixes #196)
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

2 participants