Class: AWSCDK::Cognito::UserPoolIdentityProviderGoogleProps

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

Overview

Properties to initialize UserPoolGoogleIdentityProvider.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of UserPoolIdentityProviderGoogleProps.

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 Google APIs.

  • client_secret (String, nil) (defaults to: nil)

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

  • client_secret_value (AWSCDK::SecretValue, nil) (defaults to: nil)

    The client secret to be accompanied with clientId for Google APIs to authenticate the client as SecretValue.

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

    The list of Google permissions to obtain for getting access to the Google profile.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'cognito/user_pool_identity_provider_google_props.rb', line 13

def initialize(user_pool:, attribute_mapping: nil, client_id:, client_secret: nil, client_secret_value: nil, 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") unless @client_secret.nil?
  @client_secret_value = client_secret_value
  Jsii::Type.check_type(@client_secret_value, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TZWNyZXRWYWx1ZSJ9")), "clientSecretValue") unless @client_secret_value.nil?
  @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.



36
37
38
# File 'cognito/user_pool_identity_provider_google_props.rb', line 36

def attribute_mapping
  @attribute_mapping
end

#client_idString (readonly)

The client id recognized by Google APIs.



41
42
43
# File 'cognito/user_pool_identity_provider_google_props.rb', line 41

def client_id
  @client_id
end

#client_secretString? (readonly)

Deprecated.

use clientSecretValue instead

Note:

Default: none

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



48
49
50
# File 'cognito/user_pool_identity_provider_google_props.rb', line 48

def client_secret
  @client_secret
end

#client_secret_valueAWSCDK::SecretValue? (readonly)

Note:

Default: none

The client secret to be accompanied with clientId for Google APIs to authenticate the client as SecretValue.



54
55
56
# File 'cognito/user_pool_identity_provider_google_props.rb', line 54

def client_secret_value
  @client_secret_value
end

#scopesArray<String>? (readonly)

Note:

Default: [ profile ]

The list of Google permissions to obtain for getting access to the Google profile.

Returns:

  • (Array<String>, nil)

See Also:



60
61
62
# File 'cognito/user_pool_identity_provider_google_props.rb', line 60

def scopes
  @scopes
end

#user_poolAWSCDK::Cognito::IUserPool (readonly)

The user pool to which this construct provides identities.



31
32
33
# File 'cognito/user_pool_identity_provider_google_props.rb', line 31

def user_pool
  @user_pool
end

Class Method Details

.jsii_propertiesObject



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

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

Instance Method Details

#to_jsiiObject



73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'cognito/user_pool_identity_provider_google_props.rb', line 73

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