Skip to content

Conversation

@vkagamlyk
Copy link

@vkagamlyk vkagamlyk commented Jan 16, 2023

Add the ability to Refresh Auth Token Credentials

Currently when credentials expire, driver will continue trying to connect with the outdated credentials. There is no ability to update or refresh login credentials (See neo4j#834).

This PR introduces the ability to pass an optional credentials_refresher function to an authToken object which will change credentials as they become obsolete.

There are no breaking changes introduced in this PR.

There is a test which uses a simple credentials_refresher to validate that these modifications do not break serialization.

Intended use

auth_token = basic_auth("some_login", "ignored")
auth_token.add_credentials_refresher(credentials_refresher)
self.driver = GraphDatabase.driver(uri, auth=auth_token, encrypted=True)

I'm a first-time contributor and have just signed the CLA

@Cole-Greer
Copy link

LGTM. I think it it a bit clearer if that last sentence is rearranged to something like "There is a test which uses a simple credentials_refresher to validate that these modifications do not break serialization."

@kenhuuu
Copy link

kenhuuu commented Jan 17, 2023

LGTM

1 similar comment
@xiazcy
Copy link

xiazcy commented Jan 17, 2023

LGTM

@vkagamlyk
Copy link
Author

opened as neo4j#891

@vkagamlyk vkagamlyk closed this Jan 17, 2023
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.

5 participants