BedrockAgentCoreDataPlaneFrontingLayer / Client / get_resource_oauth2_token

get_resource_oauth2_token

BedrockAgentCoreDataPlaneFrontingLayer.Client.get_resource_oauth2_token(**kwargs)

Returns the OAuth 2.0 token of the provided resource

See also: AWS API Documentation

Request Syntax

response = client.get_resource_oauth2_token(
    workloadIdentityToken='string',
    resourceCredentialProviderName='string',
    scopes=[
        'string',
    ],
    oauth2Flow='USER_FEDERATION'|'M2M',
    resourceOauth2ReturnUrl='string',
    forceAuthentication=True|False,
    customParameters={
        'string': 'string'
    }
)
Parameters:
  • workloadIdentityToken (string) –

    [REQUIRED]

    The identity token of the workload you want to retrive the Oauth2 Token of.

  • resourceCredentialProviderName (string) –

    [REQUIRED]

    Reference to the credential provider

  • scopes (list) –

    [REQUIRED]

    The OAuth scopes requested

    • (string) –

  • oauth2Flow (string) –

    [REQUIRED]

    The type of flow to be performed

  • resourceOauth2ReturnUrl (string) – Callback url to redirect after token retrieval completes. Should be one of the provideded urls during WorkloadIdentity creation

  • forceAuthentication (boolean) – If true, always initiate a new 3LO flow

  • customParameters (dict) –

    Gives the ability to send extra/custom parameters to the resource credentials provider during the authorization process. Standard OAuth2 flow parameters will not be overriden.

    • (string) –

      • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'authorizationUrl': 'string',
    'accessToken': 'string'
}

Response Structure

  • (dict) –

    • authorizationUrl (string) –

      The URL for the authorization process, provided if the Access token requires user Authorization.

    • accessToken (string) –

      OAuth2 token ready for use

Exceptions

  • BedrockAgentCoreDataPlaneFrontingLayer.Client.exceptions.UnauthorizedException

  • BedrockAgentCoreDataPlaneFrontingLayer.Client.exceptions.ValidationException

  • BedrockAgentCoreDataPlaneFrontingLayer.Client.exceptions.AccessDeniedException

  • BedrockAgentCoreDataPlaneFrontingLayer.Client.exceptions.ResourceNotFoundException

  • BedrockAgentCoreDataPlaneFrontingLayer.Client.exceptions.ThrottlingException

  • BedrockAgentCoreDataPlaneFrontingLayer.Client.exceptions.InternalServerException