Class: AWSCDK::Cognito::UserPoolIdentityProviderAmazonProps

Inherits:
UserPoolIdentityProviderProps
  • Object
show all
Defined in:
cognito/user_pool_identity_provider_amazon_props.rb

Overview

Properties to initialize UserPoolAmazonIdentityProvider.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_pool:, attribute_mapping: nil, client_id:, client_secret:, scopes: nil) ⇒ UserPoolIdentityProviderAmazonProps

Returns a new instance of UserPoolIdentityProviderAmazonProps.

Parameters:

  • user_pool (AWSCDK::Cognito::IUserPool)

    The user pool to which this construct provides identities.

  • attribute_mapping (AWSCDK::Cognito::AttributeMapping, nil) (defaults to: nil)

    Mapping attributes from the identity provider to standard and custom attributes of the user pool.

  • client_id (String)

    The client id recognized by Login with Amazon APIs.

  • client_secret (String)

    The client secret to be accompanied with clientId for Login with Amazon APIs to authenticate the client.

  • scopes (Array<String>, nil) (defaults to: nil)

    The types of user profile data to obtain for the Amazon profile.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'cognito/user_pool_identity_provider_amazon_props.rb', line 12

def initialize(user_pool:, attribute_mapping: nil, client_id:, client_secret:, scopes: nil)
  @user_pool = user_pool
  Jsii::Type.check_type(@user_pool, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29nbml0by5JVXNlclBvb2wifQ==")), "userPool")
  @attribute_mapping = attribute_mapping.is_a?(Hash) ? ::AWSCDK::Cognito::AttributeMapping.new(**attribute_mapping.transform_keys(&:to_sym)) : attribute_mapping
  Jsii::Type.check_type(@attribute_mapping, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29nbml0by5BdHRyaWJ1dGVNYXBwaW5nIn0=")), "attributeMapping") unless @attribute_mapping.nil?
  @client_id = client_id
  Jsii::Type.check_type(@client_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clientId")
  @client_secret = client_secret
  Jsii::Type.check_type(@client_secret, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clientSecret")
  @scopes = scopes
  Jsii::Type.check_type(@scopes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "scopes") unless @scopes.nil?
end

Instance Attribute Details

#attribute_mappingAWSCDK::Cognito::AttributeMapping? (readonly)

Note:

Default: - no attribute mapping

Mapping attributes from the identity provider to standard and custom attributes of the user pool.



33
34
35
# File 'cognito/user_pool_identity_provider_amazon_props.rb', line 33

def attribute_mapping
  @attribute_mapping
end

#client_idString (readonly)

The client id recognized by Login with Amazon APIs.



38
39
40
# File 'cognito/user_pool_identity_provider_amazon_props.rb', line 38

def client_id
  @client_id
end

#client_secretString (readonly)

The client secret to be accompanied with clientId for Login with Amazon APIs to authenticate the client.



43
44
45
# File 'cognito/user_pool_identity_provider_amazon_props.rb', line 43

def client_secret
  @client_secret
end

#scopesArray<String>? (readonly)

Note:

Default: [ profile ]

The types of user profile data to obtain for the Amazon profile.



49
50
51
# File 'cognito/user_pool_identity_provider_amazon_props.rb', line 49

def scopes
  @scopes
end

#user_poolAWSCDK::Cognito::IUserPool (readonly)

The user pool to which this construct provides identities.



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

def user_pool
  @user_pool
end

Class Method Details

.jsii_propertiesObject



51
52
53
54
55
56
57
58
59
# File 'cognito/user_pool_identity_provider_amazon_props.rb', line 51

def self.jsii_properties
  {
    :user_pool => "userPool",
    :attribute_mapping => "attributeMapping",
    :client_id => "clientId",
    :client_secret => "clientSecret",
    :scopes => "scopes",
  }
end

Instance Method Details

#to_jsiiObject



61
62
63
64
65
66
67
68
69
70
71
72
# File 'cognito/user_pool_identity_provider_amazon_props.rb', line 61

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "userPool" => @user_pool,
    "attributeMapping" => @attribute_mapping,
    "clientId" => @client_id,
    "clientSecret" => @client_secret,
    "scopes" => @scopes,
  })
  result.compact
end