gravitino.auth.default_oauth2_token_provider.DefaultOAuth2TokenProvider¶
- class gravitino.auth.default_oauth2_token_provider.DefaultOAuth2TokenProvider(uri: str | None = None, credential: str | None = None, scope: str | None = None, path: str | None = None)¶
Bases:
OAuth2TokenProvider
This class is the default implement of OAuth2TokenProvider.
- __init__(uri: str | None = None, credential: str | None = None, scope: str | None = None, path: str | None = None)¶
Methods
__init__
([uri, credential, scope, path])close
()Closes the OAuth2TokenProvider and releases any underlying resources.
Acquire the data of token for authentication.
Judge whether AuthDataProvider can provide token data.
validate
()Validate the OAuth2TokenProvider
- close()¶
Closes the OAuth2TokenProvider and releases any underlying resources.
- get_token_data() bytes | None ¶
Acquire the data of token for authentication. The client will set the token data as HTTP header Authorization directly. So the return value should ensure token data contain the token header (eg: Bearer, Basic) if necessary.
- Returns:
the token data is used for authentication.
- has_token_data() bool ¶
Judge whether AuthDataProvider can provide token data.
- Returns:
true if the AuthDataProvider can provide token data otherwise false.
- validate()¶
Validate the OAuth2TokenProvider