flytekit.clients.auth.token_client
| Property |
Type |
Description |
error_auth_pending |
str |
|
error_slow_down |
str |
|
utf_8 |
str |
|
def get_basic_authorization_header(
client_id: str,
client_secret: str,
) -> str
This function transforms the client id and the client secret into a header that conforms with http basic auth.
It joins the id and the secret with a : then base64 encodes it, then adds the appropriate text. Secrets are
first URL encoded to escape illegal characters.
| Parameter |
Type |
Description |
client_id |
str |
str |
client_secret |
str |
str |
Returns: str
def get_device_code(
device_auth_endpoint: str,
client_id: str,
audience: typing.Optional[str] = None,
scope: typing.Optional[typing.List[str]] = None,
http_proxy_url: typing.Optional[str] = None,
verify: typing.Union[bool, str, NoneType] = None,
session: typing.Optional[requests.sessions.Session] = None,
) -> flytekit.clients.auth.token_client.DeviceCodeResponse
Retrieves the device Authentication code that can be done to authenticate the request using a browser on a
separate device
| Parameter |
Type |
Description |
device_auth_endpoint |
str |
|
client_id |
str |
|
audience |
typing.Optional[str] |
|
scope |
typing.Optional[typing.List[str]] |
|
http_proxy_url |
typing.Optional[str] |
|
verify |
typing.Union[bool, str, NoneType] |
|
session |
typing.Optional[requests.sessions.Session] |
|
def get_token(
token_endpoint: str,
scopes: typing.Optional[typing.List[str]] = None,
authorization_header: typing.Optional[str] = None,
client_id: typing.Optional[str] = None,
device_code: typing.Optional[str] = None,
audience: typing.Optional[str] = None,
grant_type: <enum 'GrantType'> = GrantType.CLIENT_CREDS,
http_proxy_url: typing.Optional[str] = None,
verify: typing.Union[bool, str, NoneType] = None,
session: typing.Optional[requests.sessions.Session] = None,
refresh_token: typing.Optional[str] = None,
) -> typing.Tuple[str, str, int]
retrieved from the IDP, the third is the expiration in seconds
| Parameter |
Type |
Description |
token_endpoint |
str |
|
scopes |
typing.Optional[typing.List[str]] |
|
authorization_header |
typing.Optional[str] |
|
client_id |
typing.Optional[str] |
|
device_code |
typing.Optional[str] |
|
audience |
typing.Optional[str] |
|
grant_type |
<enum 'GrantType'> |
|
http_proxy_url |
typing.Optional[str] |
|
verify |
typing.Union[bool, str, NoneType] |
|
session |
typing.Optional[requests.sessions.Session] |
|
refresh_token |
typing.Optional[str] |
|
Returns: (Text,Text,Int) The first element is the access token retrieved from the IDP, the second is the refresh token
def poll_token_endpoint(
resp: flytekit.clients.auth.token_client.DeviceCodeResponse,
token_endpoint: str,
client_id: str,
audience: typing.Optional[str] = None,
scopes: typing.Optional[typing.List[str]] = None,
http_proxy_url: typing.Optional[str] = None,
verify: typing.Union[bool, str, NoneType] = None,
) -> typing.Tuple[str, str, int]
| Parameter |
Type |
Description |
resp |
flytekit.clients.auth.token_client.DeviceCodeResponse |
|
token_endpoint |
str |
|
client_id |
str |
|
audience |
typing.Optional[str] |
|
scopes |
typing.Optional[typing.List[str]] |
|
http_proxy_url |
typing.Optional[str] |
|
verify |
typing.Union[bool, str, NoneType] |
|
Response from device auth flow endpoint
{‘device_code’: ‘code’,
‘user_code’: ‘BNDJJFXL’,
‘verification_uri’: ‘url’,
’expires_in’: 600,
‘interval’: 5}
class DeviceCodeResponse(
device_code: str,
user_code: str,
verification_uri: str,
expires_in: int,
interval: int,
)
| Parameter |
Type |
Description |
device_code |
str |
|
user_code |
str |
|
verification_uri |
str |
|
expires_in |
int |
|
interval |
int |
|
def from_json_response(
j: typing.Dict,
) -> DeviceCodeResponse
| Parameter |
Type |
Description |
j |
typing.Dict |
|
class GrantType(
*args,
**kwds,
)
| Parameter |
Type |
Description |
*args |
|
|
**kwds |
|
|