Class: AWSCDK::Cognito::OAuthScope

Inherits:
Jsii::Object
  • Object
show all
Defined in:
cognito/o_auth_scope.rb

Overview

OAuth scopes that are allowed with this client.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ OAuthScope

Returns a new instance of OAuthScope.

Raises:

  • (NoMethodError)


10
11
12
# File 'cognito/o_auth_scope.rb', line 10

def initialize(*args)
  raise NoMethodError, "aws-cdk-lib.aws_cognito.OAuthScope does not have a visible constructor; use the provided factory methods"
end

Class Method Details

.COGNITO_ADMINAWSCDK::Cognito::OAuthScope

Grants access to Amazon Cognito User Pool API operations that require access tokens, such as UpdateUserAttributes and VerifyUserAttribute.

Returns:

  • (AWSCDK::Cognito::OAuthScope)


46
47
48
# File 'cognito/o_auth_scope.rb', line 46

def self.COGNITO_ADMIN()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_cognito.OAuthScope", "COGNITO_ADMIN")
end

.custom(name) ⇒ AWSCDK::Cognito::OAuthScope

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 (String)

Returns:

  • (AWSCDK::Cognito::OAuthScope)

See Also:



27
28
29
30
# File 'cognito/o_auth_scope.rb', line 27

def self.custom(name)
  Jsii::Type.check_type(name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_cognito.OAuthScope", "custom", [name])
end

.EMAILAWSCDK::Cognito::OAuthScope

Grants access to the 'email' and 'email_verified' claims.

Automatically includes access to OAuthScope.OPENID.

Returns:

  • (AWSCDK::Cognito::OAuthScope)


55
56
57
# File 'cognito/o_auth_scope.rb', line 55

def self.EMAIL()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_cognito.OAuthScope", "EMAIL")
end

.jsii_overridable_methodsObject



14
15
16
17
18
# File 'cognito/o_auth_scope.rb', line 14

def self.jsii_overridable_methods
  {
    :scope_name => { kind: :property, name: "scopeName", is_optional: false },
  }
end

.OPENIDAWSCDK::Cognito::OAuthScope

Returns all user attributes in the ID token that are readable by the client.

Returns:

  • (AWSCDK::Cognito::OAuthScope)


62
63
64
# File 'cognito/o_auth_scope.rb', line 62

def self.OPENID()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_cognito.OAuthScope", "OPENID")
end

.PHONEAWSCDK::Cognito::OAuthScope

Grants access to the 'phone_number' and 'phone_number_verified' claims.

Automatically includes access to OAuthScope.OPENID.

Returns:

  • (AWSCDK::Cognito::OAuthScope)


71
72
73
# File 'cognito/o_auth_scope.rb', line 71

def self.PHONE()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_cognito.OAuthScope", "PHONE")
end

.PROFILEAWSCDK::Cognito::OAuthScope

Grants access to all user attributes that are readable by the client Automatically includes access to OAuthScope.OPENID.

Returns:

  • (AWSCDK::Cognito::OAuthScope)


78
79
80
# File 'cognito/o_auth_scope.rb', line 78

def self.PROFILE()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_cognito.OAuthScope", "PROFILE")
end

.resource_server(server, scope) ⇒ AWSCDK::Cognito::OAuthScope

Adds a custom scope that's tied to a resource server in your stack.

Parameters:

Returns:

  • (AWSCDK::Cognito::OAuthScope)


37
38
39
40
41
# File 'cognito/o_auth_scope.rb', line 37

def self.resource_server(server, scope)
  Jsii::Type.check_type(server, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29nbml0by5JVXNlclBvb2xSZXNvdXJjZVNlcnZlciJ9")), "server")
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29nbml0by5SZXNvdXJjZVNlcnZlclNjb3BlIn0=")), "scope")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_cognito.OAuthScope", "resourceServer", [server, scope])
end

Instance Method Details

#scope_nameString

The name of this scope as recognized by CloudFormation.



86
87
88
# File 'cognito/o_auth_scope.rb', line 86

def scope_name()
  jsii_get_property("scopeName")
end