Interface IUserPoolDomainProps
Props for UserPoolDomain construct.
Namespace: Amazon.CDK.AWS.Cognito
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IUserPoolDomainProps : IUserPoolDomainOptions
Syntax (vb)
Public Interface IUserPoolDomainProps
Inherits IUserPoolDomainOptions
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.CertificateManager;
Vpc vpc;
Certificate certificate;
var lb = new ApplicationLoadBalancer(this, "LB", new ApplicationLoadBalancerProps {
Vpc = vpc,
InternetFacing = true
});
var userPool = new UserPool(this, "UserPool");
var userPoolClient = new UserPoolClient(this, "Client", new UserPoolClientProps {
UserPool = userPool,
// Required minimal configuration for use with an ELB
GenerateSecret = true,
AuthFlows = new AuthFlow {
UserPassword = true
},
OAuth = new OAuthSettings {
Flows = new OAuthFlows {
AuthorizationCodeGrant = true
},
Scopes = new [] { OAuthScope.EMAIL },
CallbackUrls = new [] { $"https://{lb.loadBalancerDnsName}/oauth2/idpresponse" }
}
});
var cfnClient = (CfnUserPoolClient)userPoolClient.Node.DefaultChild;
cfnClient.AddPropertyOverride("RefreshTokenValidity", 1);
cfnClient.AddPropertyOverride("SupportedIdentityProviders", new [] { "COGNITO" });
var userPoolDomain = new UserPoolDomain(this, "Domain", new UserPoolDomainProps {
UserPool = userPool,
CognitoDomain = new CognitoDomainOptions {
DomainPrefix = "test-cdk-prefix"
}
});
lb.AddListener("Listener", new BaseApplicationListenerProps {
Port = 443,
Certificates = new [] { certificate },
DefaultAction = new AuthenticateCognitoAction(new AuthenticateCognitoActionProps {
UserPool = userPool,
UserPoolClient = userPoolClient,
UserPoolDomain = userPoolDomain,
Next = ListenerAction.FixedResponse(200, new FixedResponseOptions {
ContentType = "text/plain",
MessageBody = "Authenticated"
})
})
});
new CfnOutput(this, "DNS", new CfnOutputProps {
Value = lb.LoadBalancerDnsName
});
Synopsis
Properties
UserPool | The user pool to which this domain should be associated. |
Properties
UserPool
The user pool to which this domain should be associated.
IUserPool UserPool { get; }
Property Value