Class: AWSCDK::Cognito::UserPoolIdentityProviderFacebookProps

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

Overview

Properties to initialize UserPoolFacebookIdentityProvider.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of UserPoolIdentityProviderFacebookProps.

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

  • client_secret (String)

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

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

    The Facebook API version to use.

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

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



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

def initialize(user_pool:, attribute_mapping: nil, client_id:, client_secret:, api_version: 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")
  @api_version = api_version
  Jsii::Type.check_type(@api_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "apiVersion") unless @api_version.nil?
  @scopes = scopes
  Jsii::Type.check_type(@scopes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "scopes") unless @scopes.nil?
end

Instance Attribute Details

#api_versionString? (readonly)

Note:

Default: - to the oldest version supported by Facebook

The Facebook API version to use.

Returns:

  • (String, nil)


50
51
52
# File 'cognito/user_pool_identity_provider_facebook_props.rb', line 50

def api_version
  @api_version
end

#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_facebook_props.rb', line 36

def attribute_mapping
  @attribute_mapping
end

#client_idString (readonly)

The client id recognized by Facebook APIs.

Returns:

  • (String)


40
41
42
# File 'cognito/user_pool_identity_provider_facebook_props.rb', line 40

def client_id
  @client_id
end

#client_secretString (readonly)

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



45
46
47
# File 'cognito/user_pool_identity_provider_facebook_props.rb', line 45

def client_secret
  @client_secret
end

#scopesArray<String>? (readonly)

Note:

Default: [ public_profile ]

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

Returns:

  • (Array<String>, nil)

See Also:



56
57
58
# File 'cognito/user_pool_identity_provider_facebook_props.rb', line 56

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_facebook_props.rb', line 31

def user_pool
  @user_pool
end

Class Method Details

.jsii_propertiesObject



58
59
60
61
62
63
64
65
66
67
# File 'cognito/user_pool_identity_provider_facebook_props.rb', line 58

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

Instance Method Details

#to_jsiiObject



69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'cognito/user_pool_identity_provider_facebook_props.rb', line 69

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