Table of Contents

Class UserPoolResourceServerOptions

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

Options to create a UserPoolResourceServer.

public class UserPoolResourceServerOptions : IUserPoolResourceServerOptions
Inheritance
UserPoolResourceServerOptions
Implements
Inherited Members

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

UserPoolResourceServerOptions()

public UserPoolResourceServerOptions()

Properties

Identifier

A unique resource server identifier for the resource server.

public string Identifier { get; set; }

Property Value

string

Scopes

Oauth scopes.

public ResourceServerScope[]? Scopes { get; set; }

Property Value

ResourceServerScope[]

Remarks

Default: - No scopes will be added

UserPoolResourceServerName

A friendly name for the resource server.

public string? UserPoolResourceServerName { get; set; }

Property Value

string

Remarks

Default: - same as identifier