Class UserPoolDomain

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.cognito.UserPoolDomain
All Implemented Interfaces:
IConstruct, IDependable, IResource, IUserPoolDomain, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:44.071Z") @Stability(Stable) public class UserPoolDomain extends Resource implements IUserPoolDomain
Define a user pool domain.

Example:

 UserPool userpool = UserPool.Builder.create(this, "UserPool").build();
 UserPoolClient client = userpool.addClient("Client", UserPoolClientOptions.builder()
         // ...
         .oAuth(OAuthSettings.builder()
                 .flows(OAuthFlows.builder()
                         .implicitCodeGrant(true)
                         .build())
                 .callbackUrls(List.of("https://myapp.com/home", "https://myapp.com/users"))
                 .build())
         .build());
 UserPoolDomain domain = userpool.addDomain("Domain", UserPoolDomainOptions.builder().build());
 String signInUrl = domain.signInUrl(client, SignInUrlOptions.builder()
         .redirectUri("https://myapp.com/home")
         .build());
 
  • Constructor Details

    • UserPoolDomain

      protected UserPoolDomain(software.amazon.jsii.JsiiObjectRef objRef)
    • UserPoolDomain

      protected UserPoolDomain(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • UserPoolDomain

      @Stability(Stable) public UserPoolDomain(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull UserPoolDomainProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromDomainName

      @Stability(Stable) @NotNull public static IUserPoolDomain fromDomainName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String userPoolDomainName)
      Import a UserPoolDomain given its domain name.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      userPoolDomainName - This parameter is required.
    • baseUrl

      @Stability(Stable) @NotNull public String baseUrl(@Nullable BaseUrlOptions options)
      The URL to the hosted UI associated with this domain.

      Parameters:
      options - options to customize baseUrl.
    • baseUrl

      @Stability(Stable) @NotNull public String baseUrl()
      The URL to the hosted UI associated with this domain.
    • signInUrl

      @Stability(Stable) @NotNull public String signInUrl(@NotNull UserPoolClient client, @NotNull SignInUrlOptions options)
      The URL to the sign in page in this domain using a specific UserPoolClient.

      Parameters:
      client - [disable-awslint:ref-via-interface] the user pool client that the UI will use to interact with the UserPool. This parameter is required.
      options - options to customize signInUrl. This parameter is required.
    • getCloudFrontDomainName

      @Stability(Stable) @NotNull public String getCloudFrontDomainName()
      The domain name of the CloudFront distribution associated with the user pool domain.
    • getDomainName

      @Stability(Stable) @NotNull public String getDomainName()
      The domain that was specified to be created.

      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.

      Specified by:
      getDomainName in interface IUserPoolDomain