Class UserPoolDomain
Define a user pool domain.
Inherited Members
Namespace: Amazon.CDK.AWS.Cognito
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class UserPoolDomain : Resource, IUserPoolDomain, IResource, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class UserPoolDomain Inherits Resource Implements IUserPoolDomain, IResource, IConstruct, IDependable, IEnvironmentAware
Remarks
ExampleMetadata: infused
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"
});
Synopsis
Constructors
| UserPoolDomain(Construct, string, IUserPoolDomainProps) | Define a user pool domain. |
Properties
| CloudFrontDomainName | (deprecated) The domain name of the CloudFront distribution associated with the user pool domain. |
| CloudFrontEndpoint | The domain name of the CloudFront distribution associated with the user pool domain. |
| DomainName | The domain that was specified to be created. |
| PROPERTY_INJECTION_ID | Uniquely identifies this class. |
Methods
| BaseUrl(IBaseUrlOptions?) | The URL to the hosted UI associated with this domain. |
| FromDomainName(Construct, string, string) | Import a UserPoolDomain given its domain name. |
| SignInUrl(UserPoolClient, ISignInUrlOptions) | The URL to the sign in page in this domain using a specific UserPoolClient. |
Constructors
UserPoolDomain(Construct, string, IUserPoolDomainProps)
Define a user pool domain.
public UserPoolDomain(Construct scope, string id, IUserPoolDomainProps props)
Parameters
- scope Construct
- id string
- props IUserPoolDomainProps
Remarks
ExampleMetadata: infused
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"
});
Properties
CloudFrontDomainName
(deprecated) The domain name of the CloudFront distribution associated with the user pool domain.
[Obsolete("use `cloudFrontEndpoint` method instead.")]
public virtual string CloudFrontDomainName { get; }
Property Value
Remarks
This method creates a custom resource internally to get the CloudFront domain name.
Stability: Deprecated
CloudFrontEndpoint
The domain name of the CloudFront distribution associated with the user pool domain.
public virtual string CloudFrontEndpoint { get; }
Property Value
Remarks
ExampleMetadata: infused
DomainName
The domain that was specified to be created.
public virtual string DomainName { get; }
Property Value
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.
PROPERTY_INJECTION_ID
Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
ExampleMetadata: infused
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
Remarks
ExampleMetadata: infused
FromDomainName(Construct, string, string)
Import a UserPoolDomain given its domain name.
public static IUserPoolDomain FromDomainName(Construct scope, string id, string userPoolDomainName)
Parameters
Returns
Remarks
ExampleMetadata: infused
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
Remarks
ExampleMetadata: infused