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

Add kerberos auth #126

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add kerberos auth #126

wants to merge 3 commits into from

Conversation

Dubrzr
Copy link

@Dubrzr Dubrzr commented Mar 27, 2018

Fixing issue #125

Only implemented for the requests call done (need to do it for urllib calls also).

@Dubrzr
Copy link
Author

Dubrzr commented Mar 27, 2018

What about urllib calls? Would you replace them with requests calls?

@mistercrunch
Copy link
Member

mistercrunch commented Apr 5, 2018

Ha! this config.py looks oddly familiar :) That looks good to me.

Now we probably want to sprinkle this across the app, for all http calls. And yes we should systematically use requests for all http requests.

There might be a way to start a requests session somehow and set the auth for the session. I have done no research though, that's just intuition...

@nishantmonu51
Copy link
Member

nishantmonu51 commented May 8, 2018

It seems that it might be easier to just use urllib instead of requests for kerberos auth across the app.

In the config.py you would do something like and then in the app wherever you use urllib, it can use the configured security.

try:
    # python3
    import urllib.request as urllib_request
except ImportError:
    # python2
    import urllib2 as urllib_request
cookieProcessor = urllib_request.HTTPCookieProcessor()
authencationHandler = urllib_kerberos.HTTPKerberosAuthHandler()
opener = urllib_request.build_opener(cookieProcessor, authencationHandler)
urllib_request.install_opener(opener)

On a side note i also filed and issue for replacing requests library usage with urllib here as it is a blocker for us - #128

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

Successfully merging this pull request may close these issues.

3 participants