OAuthScope

class aws_cdk.aws_cognito.OAuthScope(*args: Any, **kwargs)

Bases: object

OAuth scopes that are allowed with this client.

See

https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-app-idp-settings.html

Example:

pool = cognito.UserPool(self, "Pool")
pool.add_client("app-client",
    o_auth=cognito.OAuthSettings(
        flows=cognito.OAuthFlows(
            authorization_code_grant=True
        ),
        scopes=[cognito.OAuthScope.OPENID],
        callback_urls=["https://my-app-domain.com/welcome"],
        logout_urls=["https://my-app-domain.com/signin"]
    )
)

Attributes

COGNITO_ADMIN = <aws_cdk.aws_cognito.OAuthScope object>
EMAIL = <aws_cdk.aws_cognito.OAuthScope object>
OPENID = <aws_cdk.aws_cognito.OAuthScope object>
PHONE = <aws_cdk.aws_cognito.OAuthScope object>
PROFILE = <aws_cdk.aws_cognito.OAuthScope object>
scope_name

The name of this scope as recognized by CloudFormation.

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpoolclient.html#cfn-cognito-userpoolclient-allowedoauthscopes

Return type

str

Static Methods

classmethod custom(name)

Custom scope is one that you define for your own resource server in the Resource Servers.

The format is ‘resource-server-identifier/scope’.

Parameters

name (str) –

See

https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-define-resource-servers.html

Return type

OAuthScope

classmethod resource_server(server, scope)

Adds a custom scope that’s tied to a resource server in your stack.

Parameters
Return type

OAuthScope