CognitoIdentityProvider / Client / create_resource_server

create_resource_server#

CognitoIdentityProvider.Client.create_resource_server(**kwargs)#

Creates a new OAuth2.0 resource server and defines custom scopes within it.

See also: AWS API Documentation

Request Syntax

response = client.create_resource_server(
    UserPoolId='string',
    Identifier='string',
    Name='string',
    Scopes=[
        {
            'ScopeName': 'string',
            'ScopeDescription': 'string'
        },
    ]
)
Parameters:
  • UserPoolId (string) –

    [REQUIRED]

    The user pool ID for the user pool.

  • Identifier (string) –

    [REQUIRED]

    A unique resource server identifier for the resource server. This could be an HTTPS endpoint where the resource server is located, such as https://my-weather-api.example.com.

  • Name (string) –

    [REQUIRED]

    A friendly name for the resource server.

  • Scopes (list) –

    A list of scopes. Each scope is a key-value map with the keys name and description.

    • (dict) –

      A resource server scope.

      • ScopeName (string) – [REQUIRED]

        The name of the scope.

      • ScopeDescription (string) – [REQUIRED]

        A description of the scope.

Return type:

dict

Returns:

Response Syntax

{
    'ResourceServer': {
        'UserPoolId': 'string',
        'Identifier': 'string',
        'Name': 'string',
        'Scopes': [
            {
                'ScopeName': 'string',
                'ScopeDescription': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) –

    • ResourceServer (dict) –

      The newly created resource server.

      • UserPoolId (string) –

        The user pool ID for the user pool that hosts the resource server.

      • Identifier (string) –

        The identifier for the resource server.

      • Name (string) –

        The name of the resource server.

      • Scopes (list) –

        A list of scopes that are defined for the resource server.

        • (dict) –

          A resource server scope.

          • ScopeName (string) –

            The name of the scope.

          • ScopeDescription (string) –

            A description of the scope.

Exceptions

  • CognitoIdentityProvider.Client.exceptions.InvalidParameterException

  • CognitoIdentityProvider.Client.exceptions.ResourceNotFoundException

  • CognitoIdentityProvider.Client.exceptions.NotAuthorizedException

  • CognitoIdentityProvider.Client.exceptions.TooManyRequestsException

  • CognitoIdentityProvider.Client.exceptions.LimitExceededException

  • CognitoIdentityProvider.Client.exceptions.InternalErrorException