Table of Contents

Class ResourceServerScope

Namespace
Amazon.CDK.AWS.Cognito
Assembly
Amazon.CDK.AWS.Cognito.dll

A scope for ResourceServer.

public class ResourceServerScope : DeputyBase
Inheritance
ResourceServerScope

Examples

var pool = new UserPool(this, "Pool");

            var readOnlyScope = new ResourceServerScope(new ResourceServerScopeProps { ScopeName = "read", ScopeDescription = "Read-only access" });
            var fullAccessScope = new ResourceServerScope(new ResourceServerScopeProps { ScopeName = "*", ScopeDescription = "Full access" });

            var userServer = pool.AddResourceServer("ResourceServer", new UserPoolResourceServerOptions {
                Identifier = "users",
                Scopes = new [] { readOnlyScope, fullAccessScope }
            });

            var readOnlyClient = pool.AddClient("read-only-client", new UserPoolClientOptions {
                // ...
                OAuth = new OAuthSettings {
                    // ...
                    Scopes = new [] { OAuthScope.ResourceServer(userServer, readOnlyScope) }
                }
            });

            var fullAccessClient = pool.AddClient("full-access-client", new UserPoolClientOptions {
                // ...
                OAuth = new OAuthSettings {
                    // ...
                    Scopes = new [] { OAuthScope.ResourceServer(userServer, fullAccessScope) }
                }
            });

Remarks

ExampleMetadata: infused

Constructors

ResourceServerScope(IResourceServerScopeProps)

public ResourceServerScope(IResourceServerScopeProps props)

Parameters

props IResourceServerScopeProps

Properties

ScopeDescription

A description of the scope.

public virtual string ScopeDescription { get; }

Property Value

string

ScopeName

The name of the scope.

public virtual string ScopeName { get; }

Property Value

string