enum RoleMappingMatchType
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Cognito.IdentityPool.Alpha.RoleMappingMatchType |
![]() | github.com/aws/aws-cdk-go/awscdkcognitoidentitypoolalpha/v2#RoleMappingMatchType |
![]() | software.amazon.awscdk.services.cognito.identitypool.alpha.RoleMappingMatchType |
![]() | aws_cdk.aws_cognito_identitypool_alpha.RoleMappingMatchType |
![]() | @aws-cdk/aws-cognito-identitypool-alpha ยป RoleMappingMatchType |
Types of matches allowed for role mapping.
Example
import { IdentityPoolProviderUrl, RoleMappingMatchType } from '@aws-cdk/aws-cognito-identitypool-alpha';
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.