get_resource_oauth2_token¶
Operation¶
get_resource_oauth2_token
async
¶
get_resource_oauth2_token(input: GetResourceOauth2TokenInput, plugins: list[Plugin] | None = None) -> GetResourceOauth2TokenOutput
Returns the OAuth 2.0 token of the provided resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
GetResourceOauth2TokenInput
|
An instance of |
required |
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
Returns:
| Type | Description |
|---|---|
GetResourceOauth2TokenOutput
|
An instance of |
Input¶
GetResourceOauth2TokenInput
dataclass
¶
Dataclass for GetResourceOauth2TokenInput structure.
Attributes¶
audiences
class-attribute
instance-attribute
¶
The audiences to include in the token request. These are used to specify the intended recipients of the OAuth2 token.
custom_parameters
class-attribute
instance-attribute
¶
A map of custom parameters to include in the authorization request to the resource credential provider. These parameters are in addition to the standard OAuth 2.0 flow parameters, and will not override them.
custom_state
class-attribute
instance-attribute
¶
An opaque string that will be sent back to the callback URL provided in resourceOauth2ReturnUrl. This state should be used to protect the callback URL of your application against CSRF attacks by ensuring the response corresponds to the original request.
force_authentication
class-attribute
instance-attribute
¶
force_authentication: bool | None = None
Indicates whether to always initiate a new three-legged OAuth (3LO) flow, regardless of any existing session.
oauth2_flow
class-attribute
instance-attribute
¶
oauth2_flow: Oauth2FlowType | None = None
The type of flow to be performed.
resource_credential_provider_name
class-attribute
instance-attribute
¶
resource_credential_provider_name: str | None = None
The name of the resource's credential provider.
resource_oauth2_return_url
class-attribute
instance-attribute
¶
resource_oauth2_return_url: str | None = None
The callback URL to redirect to after the OAuth 2.0 token retrieval is complete. This URL must be one of the provided URLs configured for the workload identity.
resources
class-attribute
instance-attribute
¶
The resources to include in the token request. These are used to specify the target resources for which the OAuth2 token is being requested.
scopes
class-attribute
instance-attribute
¶
The OAuth scopes being requested.
Output¶
GetResourceOauth2TokenOutput
dataclass
¶
Dataclass for GetResourceOauth2TokenOutput structure.
Attributes¶
access_token
class-attribute
instance-attribute
¶
The OAuth 2.0 access token to use.
authorization_url
class-attribute
instance-attribute
¶
The URL to initiate the authorization process, provided when the access token requires user authorization.
session_status
class-attribute
instance-attribute
¶
session_status: SessionStatus | None = None
Status indicating whether the user's authorization session is in progress or has failed. This helps determine the next steps in the OAuth2 authentication flow.