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 the ability to pass in a requests.Session object in to Khoros init module #56

Open
rzuckerm opened this issue Sep 16, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@rzuckerm
Copy link

rzuckerm commented Sep 16, 2022

Related Core Subclass(es)

  • khoros.core.Khoros

Related Module(s)

  • Not sure, but any low-level call to requests would be affected.

Details

Our staging server is behind a "basic authentication" wall, so we cannot use this package as is since there is no way to pass an existing session in the khoros init module. Ideally, it would be nice to be able to do something like this:

with requests.Session() as session:
    session.auth = (basic_auth_username, basic_auth_password)
    khoros_api = Khoros(..., session=session)
    khoros_api.<something>(...)
@rzuckerm rzuckerm added the enhancement New feature or request label Sep 16, 2022
@jeffshurtliff
Copy link
Owner

Hi @rzuckerm,

I can definitely work on this. That being said, if you just have a Stage environment restricted with HTACCESS credentials, then you can just pass the credentials in as part of the community_url and it will work.

For example:

khoros = Khoros(
    community_url='https://user123:[email protected]',
    session_auth={'username': USERNAME, 'password': PASSWD}
)

Hope this helps!

@rzuckerm
Copy link
Author

@jeffshurtliff That worked, thanks!

@jeffshurtliff jeffshurtliff added this to the v6.0.0 milestone Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants