aws-cdk-lib.aws_cognito.ResourceServerScope

class ResourceServerScope

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

A scope for ResourceServer.

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) ],
  },
});

Initializer

new ResourceServerScope(props: ResourceServerScopeProps)

Parameters

  • props ResourceServerScopeProps

Properties

NameTypeDescription
scopeDescriptionstringA description of the scope.
scopeNamestringThe name of the scope.

scopeDescription

Type: string

A description of the scope.


scopeName

Type: string

The name of the scope.