Table of Contents

Interface IUserPoolResourceServerOptions

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

Options to create a UserPoolResourceServer.

public interface IUserPoolResourceServerOptions

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

Properties

Identifier

A unique resource server identifier for the resource server.

string Identifier { get; }

Property Value

string

Scopes

Oauth scopes.

ResourceServerScope[]? Scopes { get; }

Property Value

ResourceServerScope[]

Remarks

Default: - No scopes will be added

UserPoolResourceServerName

A friendly name for the resource server.

string? UserPoolResourceServerName { get; }

Property Value

string

Remarks

Default: - same as identifier