Skip to content

Conversation

landerlini
Copy link

Using oauth2proxy it is not difficult to configure ELOG to authenticate users based on IAM client.
Unfortunately, passing through the proxy with this python client requires adding a header including the Bearer token generated by the user interacting with the IAM.

This pull request introduces an additional argument to the constructor of the elog object to pass an access token.
Since the client application may have it's own workflow to keep the access token updated, the argument can be a callable, in which case it is called to retrieve the token at each call.

Example.

logbook = elog.open(
    'https://elog.example.com', 
    'my_logbook', 
    use_ssl=True, 
    port=443, 
    user='my_username',
    bearer_token=lambda: open("/path/to/my/token").read()
)

logbook.get_message_ids()

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.

1 participant