enum RoleMappingMatchType
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Cognito.IdentityPool.RoleMappingMatchType |
![]() | software.amazon.awscdk.services.cognito.identitypool.RoleMappingMatchType |
![]() | aws_cdk.aws_cognito_identitypool.RoleMappingMatchType |
![]() | @aws-cdk/aws-cognito-identitypool » RoleMappingMatchType |
Types of matches allowed for Role Mapping.
Example
import { IdentityPoolProviderUrl, RoleMappingMatchType } from '@aws-cdk/aws-cognito-identitypool';
declare const adminRole: iam.Role;
declare const nonAdminRole: iam.Role;
new IdentityPool(this, 'myidentitypool', {
identityPoolName: 'myidentitypool',
// Assign specific roles to users based on whether or not the custom admin claim is passed from the identity provider
roleMappings: [{
providerUrl: IdentityPoolProviderUrl.AMAZON,
rules: [
{
claim: 'custom:admin',
claimValue: 'admin',
mappedRole: adminRole,
},
{
claim: 'custom:admin',
claimValue: 'admin',
matchType: RoleMappingMatchType.NOTEQUAL,
mappedRole: nonAdminRole,
}
],
}],
});
Members
Name | Description |
---|---|
EQUALS | The Claim from the token must equal the given value in order for a match. |
CONTAINS | The Claim from the token must contain the given value in order for a match. |
STARTS_WITH | The Claim from the token must start with the given value in order for a match. |
NOTEQUAL | The Claim from the token must not equal the given value in order for a match. |
EQUALS
The Claim from the token must equal the given value in order for a match.
CONTAINS
The Claim from the token must contain the given value in order for a match.
STARTS_WITH
The Claim from the token must start with the given value in order for a match.
NOTEQUAL
The Claim from the token must not equal the given value in order for a match.