SupportsRefreshToken
Anything that can hand over a refresh token with its client ID and tenant.
Usage
SupportsRefreshToken()A runtime-checkable protocol with one method, get_refresh_token(), returning a RefreshTokenInfo. RefreshTokenInfo itself, RefreshTokenCredential, DeviceCodeCredential and InteractiveBrowserCredential implement it; spark_storage_conf() and RefreshTokenCredential accept any of them where a refresh token is expected. azure-identity credentials do not: they keep refresh tokens private.
Examples
from dazapiz import RefreshTokenInfo, SupportsRefreshToken
class FromVault:
def get_refresh_token(self) -> RefreshTokenInfo:
return RefreshTokenInfo(token=read_secret(), client_id=CLIENT, tenant_id=TENANT)
isinstance(FromVault(), SupportsRefreshToken) # TrueMethods
| Name | Description |
|---|---|
| get_refresh_token() | Return the refresh token with its client ID and tenant. |
get_refresh_token()
Return the refresh token with its client ID and tenant.
Usage
get_refresh_token()Returns
RefreshTokenInfo- The token and what it belongs to.