KeyVaultAuthentication Class
Authentication class to be used as credentials for the KeyVaultClient. :Example Usage:
def auth_callack(server, resource, scope): self.data_creds = self.data_creds or ServicePrincipalCredentials(client_id=self.config.client_id, secret=self.config.client_secret, tenant=self.config.tenant_id, resource=resource)
token = self.data_creds.token
return token['token_type'], token['access_token']
self.keyvault_data_client = KeyVaultClient(KeyVaultAuthentication(auth_callack))
- Inheritance
-
KeyVaultAuthentication
Constructor
KeyVaultAuthentication(authorization_callback=None, credentials=None)
Parameters
- authorization_callback
- credentials
Methods
| refresh_session |
Return updated session if token has expired, attempts to refresh using refresh token. |
| signed_session |
Create requests session with any required auth headers applied. If a session object is provided, configure it directly. Otherwise, create a new session and return it. |
refresh_session
Return updated session if token has expired, attempts to refresh using refresh token.
refresh_session()
Return type
signed_session
Create requests session with any required auth headers applied.
If a session object is provided, configure it directly. Otherwise, create a new session and return it.
signed_session(session=None)
Parameters
- session
- <xref:requests.Session>
The session to configure for authentication
Return type
Feedback
Submit and view feedback for