Class UserPoolResourceServer

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.cognito.UserPoolResourceServer
All Implemented Interfaces:
IResource, IUserPoolResourceServer, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-25T14:21:12.574Z") @Stability(Stable) public class UserPoolResourceServer extends Resource implements IUserPoolResourceServer
Defines a User Pool OAuth2.0 Resource Server.

Example:

 UserPool pool = new UserPool(this, "Pool");
 ResourceServerScope readOnlyScope = ResourceServerScope.Builder.create().scopeName("read").scopeDescription("Read-only access").build();
 ResourceServerScope fullAccessScope = ResourceServerScope.Builder.create().scopeName("*").scopeDescription("Full access").build();
 UserPoolResourceServer userServer = pool.addResourceServer("ResourceServer", UserPoolResourceServerOptions.builder()
         .identifier("users")
         .scopes(List.of(readOnlyScope, fullAccessScope))
         .build());
 UserPoolClient readOnlyClient = pool.addClient("read-only-client", UserPoolClientOptions.builder()
         // ...
         .oAuth(OAuthSettings.builder()
                 // ...
                 .scopes(List.of(OAuthScope.resourceServer(userServer, readOnlyScope)))
                 .build())
         .build());
 UserPoolClient fullAccessClient = pool.addClient("full-access-client", UserPoolClientOptions.builder()
         // ...
         .oAuth(OAuthSettings.builder()
                 // ...
                 .scopes(List.of(OAuthScope.resourceServer(userServer, fullAccessScope)))
                 .build())
         .build());
 
  • Constructor Details

    • UserPoolResourceServer

      protected UserPoolResourceServer(software.amazon.jsii.JsiiObjectRef objRef)
    • UserPoolResourceServer

      protected UserPoolResourceServer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • UserPoolResourceServer

      @Stability(Stable) public UserPoolResourceServer(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull UserPoolResourceServerProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromUserPoolResourceServerId

      @Stability(Stable) @NotNull public static IUserPoolResourceServer fromUserPoolResourceServerId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String userPoolResourceServerId)
      Import a user pool resource client given its id.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      userPoolResourceServerId - This parameter is required.
    • getUserPoolResourceServerId

      @Stability(Stable) @NotNull public String getUserPoolResourceServerId()
      Resource server id.
      Specified by:
      getUserPoolResourceServerId in interface IUserPoolResourceServer