Skip to content
v2.274.0

ResourceServerScopeProps Struct ​

Props to initialize ResourceServerScope.

Example ​

ts
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 ​

scopeDescriptionstringscope_descriptionstrscopeDescriptionStringScopeDescriptionstringScopeDescription*stringrequired#
A description of the scope.
scopeNamestringscope_namestrscopeNameStringScopeNamestringScopeName*stringrequired#
The name of the scope.