Class CfnUserPoolClient
The AWS::Cognito::UserPoolClient
resource specifies an Amazon Cognito user pool client.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.Cognito
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnUserPoolClient : CfnResource, IInspectable
Syntax (vb)
Public Class CfnUserPoolClient
Inherits CfnResource
Implements IInspectable
Remarks
If you don't specify a value for a parameter, Amazon Cognito sets it to a default value.
CloudformationResource: AWS::Cognito::UserPoolClient
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
Constructors
CfnUserPoolClient(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnUserPoolClient(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnUserPoolClient(Construct, String, ICfnUserPoolClientProps) |
Properties
AccessTokenValidity | The access token time limit. |
AllowedOAuthFlows | The OAuth grant types that you want your app client to generate. |
AllowedOAuthFlowsUserPoolClient | Set to |
AllowedOAuthScopes | The allowed OAuth scopes. |
AnalyticsConfiguration | The user pool analytics configuration for collecting metrics and sending them to your Amazon Pinpoint campaign. |
AttrClientId | The ID of the app client, for example |
AttrClientSecret | |
AttrName | |
AuthSessionValidity | Amazon Cognito creates a session token for each API request in an authentication flow. |
CallbackUrLs | A list of allowed redirect (callback) URLs for the IdPs. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
ClientName | The client name for the user pool client you would like to create. |
DefaultRedirectUri | The default redirect URI. |
EnablePropagateAdditionalUserContextData | Activates the propagation of additional user context data. |
EnableTokenRevocation | Activates or deactivates token revocation. |
ExplicitAuthFlows | The authentication flows that you want your user pool client to support. |
GenerateSecret | Boolean to specify whether you want to generate a secret for the user pool client being created. |
IdTokenValidity | The ID token time limit. |
LogoutUrLs | A list of allowed logout URLs for the IdPs. |
PreventUserExistenceErrors | Use this setting to choose which errors and responses are returned by Cognito APIs during authentication, account confirmation, and password recovery when the user does not exist in the user pool. |
ReadAttributes | The list of user attributes that you want your app client to have read access to. |
RefreshTokenValidity | The refresh token time limit. |
SupportedIdentityProviders | A list of provider names for the identity providers (IdPs) that are supported on this client. |
TokenValidityUnits | The units in which the validity times are represented. |
UserPoolId | The user pool ID for the user pool where you want to create a user pool client. |
WriteAttributes | The list of user attributes that you want your app client to have write access to. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnUserPoolClient(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnUserPoolClient(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnUserPoolClient(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnUserPoolClient(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnUserPoolClient(Construct, String, ICfnUserPoolClientProps)
public CfnUserPoolClient(Construct scope, string id, ICfnUserPoolClientProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnUserPoolClientProps
Resource properties.
Properties
AccessTokenValidity
The access token time limit.
public virtual Nullable<double> AccessTokenValidity { get; set; }
Property Value
System.Nullable<System.Double>
AllowedOAuthFlows
The OAuth grant types that you want your app client to generate.
public virtual string[] AllowedOAuthFlows { get; set; }
Property Value
System.String[]
AllowedOAuthFlowsUserPoolClient
Set to true
to use OAuth 2.0 features in your user pool app client.
public virtual object AllowedOAuthFlowsUserPoolClient { get; set; }
Property Value
System.Object
AllowedOAuthScopes
The allowed OAuth scopes.
public virtual string[] AllowedOAuthScopes { get; set; }
Property Value
System.String[]
AnalyticsConfiguration
The user pool analytics configuration for collecting metrics and sending them to your Amazon Pinpoint campaign.
public virtual object AnalyticsConfiguration { get; set; }
Property Value
System.Object
AttrClientId
The ID of the app client, for example 1example23456789
.
public virtual string AttrClientId { get; }
Property Value
System.String
Remarks
CloudformationAttribute: ClientId
AttrClientSecret
public virtual string AttrClientSecret { get; }
Property Value
System.String
Remarks
CloudformationAttribute: ClientSecret
AttrName
public virtual string AttrName { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Name
AuthSessionValidity
Amazon Cognito creates a session token for each API request in an authentication flow.
public virtual Nullable<double> AuthSessionValidity { get; set; }
Property Value
System.Nullable<System.Double>
CallbackUrLs
A list of allowed redirect (callback) URLs for the IdPs.
public virtual string[] CallbackUrLs { get; set; }
Property Value
System.String[]
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
ClientName
The client name for the user pool client you would like to create.
public virtual string ClientName { get; set; }
Property Value
System.String
DefaultRedirectUri
The default redirect URI.
public virtual string DefaultRedirectUri { get; set; }
Property Value
System.String
EnablePropagateAdditionalUserContextData
Activates the propagation of additional user context data.
public virtual object EnablePropagateAdditionalUserContextData { get; set; }
Property Value
System.Object
EnableTokenRevocation
Activates or deactivates token revocation.
public virtual object EnableTokenRevocation { get; set; }
Property Value
System.Object
Remarks
For more information about revoking tokens, see RevokeToken .
ExplicitAuthFlows
The authentication flows that you want your user pool client to support.
public virtual string[] ExplicitAuthFlows { get; set; }
Property Value
System.String[]
GenerateSecret
Boolean to specify whether you want to generate a secret for the user pool client being created.
public virtual object GenerateSecret { get; set; }
Property Value
System.Object
IdTokenValidity
The ID token time limit.
public virtual Nullable<double> IdTokenValidity { get; set; }
Property Value
System.Nullable<System.Double>
LogoutUrLs
A list of allowed logout URLs for the IdPs.
public virtual string[] LogoutUrLs { get; set; }
Property Value
System.String[]
PreventUserExistenceErrors
Use this setting to choose which errors and responses are returned by Cognito APIs during authentication, account confirmation, and password recovery when the user does not exist in the user pool.
public virtual string PreventUserExistenceErrors { get; set; }
Property Value
System.String
ReadAttributes
The list of user attributes that you want your app client to have read access to.
public virtual string[] ReadAttributes { get; set; }
Property Value
System.String[]
RefreshTokenValidity
The refresh token time limit.
public virtual Nullable<double> RefreshTokenValidity { get; set; }
Property Value
System.Nullable<System.Double>
SupportedIdentityProviders
A list of provider names for the identity providers (IdPs) that are supported on this client.
public virtual string[] SupportedIdentityProviders { get; set; }
Property Value
System.String[]
TokenValidityUnits
The units in which the validity times are represented.
public virtual object TokenValidityUnits { get; set; }
Property Value
System.Object
UserPoolId
The user pool ID for the user pool where you want to create a user pool client.
public virtual string UserPoolId { get; set; }
Property Value
System.String
WriteAttributes
The list of user attributes that you want your app client to have write access to.
public virtual string[] WriteAttributes { get; set; }
Property Value
System.String[]
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>