Class OAuthScope
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.cognito.OAuthScope
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:44.026Z")
@Stability(Stable)
public class OAuthScope
extends software.amazon.jsii.JsiiObject
OAuth scopes that are allowed with this client.
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());
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final OAuthScopeGrants access to Amazon Cognito User Pool API operations that require access tokens, such as UpdateUserAttributes and VerifyUserAttribute.static final OAuthScopeGrants access to the 'email' and 'email_verified' claims.static final OAuthScopeReturns all user attributes in the ID token that are readable by the client.static final OAuthScopeGrants access to the 'phone_number' and 'phone_number_verified' claims.static final OAuthScopeGrants access to all user attributes that are readable by the client Automatically includes access toOAuthScope.OPENID. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOAuthScope(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedOAuthScope(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic OAuthScopeCustom scope is one that you define for your own resource server in the Resource Servers.The name of this scope as recognized by CloudFormation.static OAuthScoperesourceServer(IUserPoolResourceServer server, ResourceServerScope scope) Adds a custom scope that's tied to a resource server in your stack.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
COGNITO_ADMIN
Grants access to Amazon Cognito User Pool API operations that require access tokens, such as UpdateUserAttributes and VerifyUserAttribute. -
EMAIL
Grants access to the 'email' and 'email_verified' claims.Automatically includes access to
OAuthScope.OPENID. -
OPENID
Returns all user attributes in the ID token that are readable by the client. -
PHONE
Grants access to the 'phone_number' and 'phone_number_verified' claims.Automatically includes access to
OAuthScope.OPENID. -
PROFILE
Grants access to all user attributes that are readable by the client Automatically includes access toOAuthScope.OPENID.
-
-
Constructor Details
-
OAuthScope
protected OAuthScope(software.amazon.jsii.JsiiObjectRef objRef) -
OAuthScope
protected OAuthScope(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
custom
Custom scope is one that you define for your own resource server in the Resource Servers.The format is 'resource-server-identifier/scope'.
- Parameters:
name- This parameter is required.- See Also:
-
resourceServer
@Stability(Stable) @NotNull public static OAuthScope resourceServer(@NotNull IUserPoolResourceServer server, @NotNull ResourceServerScope scope) Adds a custom scope that's tied to a resource server in your stack.- Parameters:
server- This parameter is required.scope- This parameter is required.
-
getScopeName
The name of this scope as recognized by CloudFormation.
-