aws-cdk-lib.aws_cognito.UserPoolResourceServerOptions

interface UserPoolResourceServerOptions

LanguageType name
.NETAmazon.CDK.AWS.Cognito.UserPoolResourceServerOptions
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscognito#UserPoolResourceServerOptions
Javasoftware.amazon.awscdk.services.cognito.UserPoolResourceServerOptions
Pythonaws_cdk.aws_cognito.UserPoolResourceServerOptions
TypeScript (source)aws-cdk-lib » aws_cognito » UserPoolResourceServerOptions

Options to create a UserPoolResourceServer.

Example

const pool = new cognito.UserPool(this, 'Pool');

const readOnlyScope = new cognito.ResourceServerScope({ scopeName: 'read', scopeDescription: 'Read-only access' });
const fullAccessScope = new cognito.ResourceServerScope({ scopeName: '*', scopeDescription: 'Full access' });

const userServer = pool.addResourceServer('ResourceServer', {
  identifier: 'users',
  scopes: [ readOnlyScope, fullAccessScope ],
});

const readOnlyClient = pool.addClient('read-only-client', {
  // ...
  oAuth: {
    // ...
    scopes: [ cognito.OAuthScope.resourceServer(userServer, readOnlyScope) ],
  },
});

const fullAccessClient = pool.addClient('full-access-client', {
  // ...
  oAuth: {
    // ...
    scopes: [ cognito.OAuthScope.resourceServer(userServer, fullAccessScope) ],
  },
});

Properties

NameTypeDescription
identifierstringA unique resource server identifier for the resource server.
scopes?ResourceServerScope[]Oauth scopes.
userPoolResourceServerName?stringA friendly name for the resource server.

identifier

Type: string

A unique resource server identifier for the resource server.


scopes?

Type: ResourceServerScope[] (optional, default: No scopes will be added)

Oauth scopes.


userPoolResourceServerName?

Type: string (optional, default: same as identifier)

A friendly name for the resource server.