Table of Contents

Class UserPoolDomain

Namespace
Amazon.CDK.AWS.Cognito
Assembly
Amazon.CDK.AWS.Cognito.dll

Define a user pool domain.

public class UserPoolDomain : Resource, IUserPoolDomain, IResource, IConstruct, IConstruct, IDependable
Inheritance
UserPoolDomain
Implements
IResource
IConstruct
IConstruct
IDependable

Examples

var userpool = new UserPool(this, "UserPool", new UserPoolProps { });
            var client = userpool.AddClient("Client", new UserPoolClientOptions {
                // ...
                OAuth = new OAuthSettings {
                    Flows = new OAuthFlows {
                        ImplicitCodeGrant = true
                    },
                    CallbackUrls = new [] { "https://myapp.com/home", "https://myapp.com/users" }
                }
            });
            var domain = userpool.AddDomain("Domain", new UserPoolDomainOptions { });
            var signInUrl = domain.SignInUrl(client, new SignInUrlOptions {
                RedirectUri = "https://myapp.com/home"
            });

Remarks

ExampleMetadata: infused

Constructors

UserPoolDomain(Construct, string, IUserPoolDomainProps)

public UserPoolDomain(Construct scope, string id, IUserPoolDomainProps props)

Parameters

scope Construct
id string
props IUserPoolDomainProps

Properties

CloudFrontDomainName

The domain name of the CloudFront distribution associated with the user pool domain.

public virtual string CloudFrontDomainName { get; }

Property Value

string

DomainName

The domain that was specified to be created.

public virtual string DomainName { get; }

Property Value

string

Remarks

If customDomain was selected, this holds the full domain name that was specified. If the cognitoDomain was used, it contains the prefix to the Cognito hosted domain.

Methods

BaseUrl(IBaseUrlOptions?)

The URL to the hosted UI associated with this domain.

public virtual string BaseUrl(IBaseUrlOptions? options = null)

Parameters

options IBaseUrlOptions

options to customize baseUrl.

Returns

string

FromDomainName(Construct, string, string)

Import a UserPoolDomain given its domain name.

public static IUserPoolDomain FromDomainName(Construct scope, string id, string userPoolDomainName)

Parameters

scope Construct
id string
userPoolDomainName string

Returns

IUserPoolDomain

SignInUrl(UserPoolClient, ISignInUrlOptions)

The URL to the sign in page in this domain using a specific UserPoolClient.

public virtual string SignInUrl(UserPoolClient client, ISignInUrlOptions options)

Parameters

client UserPoolClient

[disable-awslint:ref-via-interface] the user pool client that the UI will use to interact with the UserPool.

options ISignInUrlOptions

options to customize signInUrl.

Returns

string