Class: AWSCDK::Cognito::UserPoolIdentityProviderOidcProps

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

Overview

Properties to initialize UserPoolIdentityProviderOidc.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_pool:, attribute_mapping: nil, client_id:, client_secret:, issuer_url:, attribute_request_method: nil, endpoints: nil, identifiers: nil, name: nil, scopes: nil) ⇒ UserPoolIdentityProviderOidcProps

Returns a new instance of UserPoolIdentityProviderOidcProps.

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.

  • client_secret (String)

    The client secret.

  • issuer_url (String)

    Issuer URL.

  • attribute_request_method (AWSCDK::Cognito::OidcAttributeRequestMethod, nil) (defaults to: nil)

    The method to use to request attributes.

  • endpoints (AWSCDK::Cognito::OidcEndpoints, nil) (defaults to: nil)

    OpenID connect endpoints.

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

    Identifiers.

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

    The name of the provider.

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

    The OAuth 2.0 scopes that you will request from OpenID Connect. Scopes are groups of OpenID Connect user attributes to exchange with your app.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'cognito/user_pool_identity_provider_oidc_props.rb', line 17

def initialize(user_pool:, attribute_mapping: nil, client_id:, client_secret:, issuer_url:, attribute_request_method: nil, endpoints: nil, identifiers: nil, name: 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")
  @issuer_url = issuer_url
  Jsii::Type.check_type(@issuer_url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "issuerUrl")
  @attribute_request_method = attribute_request_method
  Jsii::Type.check_type(@attribute_request_method, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29nbml0by5PaWRjQXR0cmlidXRlUmVxdWVzdE1ldGhvZCJ9")), "attributeRequestMethod") unless @attribute_request_method.nil?
  @endpoints = endpoints.is_a?(Hash) ? ::AWSCDK::Cognito::OidcEndpoints.new(**endpoints.transform_keys(&:to_sym)) : endpoints
  Jsii::Type.check_type(@endpoints, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29nbml0by5PaWRjRW5kcG9pbnRzIn0=")), "endpoints") unless @endpoints.nil?
  @identifiers = identifiers
  Jsii::Type.check_type(@identifiers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "identifiers") unless @identifiers.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.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.



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

def attribute_mapping
  @attribute_mapping
end

#attribute_request_methodAWSCDK::Cognito::OidcAttributeRequestMethod? (readonly)

Note:

Default: OidcAttributeRequestMethod.GET

The method to use to request attributes.



65
66
67
# File 'cognito/user_pool_identity_provider_oidc_props.rb', line 65

def attribute_request_method
  @attribute_request_method
end

#client_idString (readonly)

The client id.

Returns:

  • (String)


52
53
54
# File 'cognito/user_pool_identity_provider_oidc_props.rb', line 52

def client_id
  @client_id
end

#client_secretString (readonly)

The client secret.

Returns:

  • (String)


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

def client_secret
  @client_secret
end

#endpointsAWSCDK::Cognito::OidcEndpoints? (readonly)

Note:

Default: - auto discovered with issuer URL

OpenID connect endpoints.



70
71
72
# File 'cognito/user_pool_identity_provider_oidc_props.rb', line 70

def endpoints
  @endpoints
end

#identifiersArray<String>? (readonly)

Note:

Default: - no identifiers used

Identifiers.

Identifiers can be used to redirect users to the correct IdP in multitenant apps.

Returns:

  • (Array<String>, nil)


77
78
79
# File 'cognito/user_pool_identity_provider_oidc_props.rb', line 77

def identifiers
  @identifiers
end

#issuer_urlString (readonly)

Issuer URL.

Returns:

  • (String)


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

def issuer_url
  @issuer_url
end

#nameString? (readonly)

Note:

Default: - the unique ID of the construct

The name of the provider.

Returns:

  • (String, nil)


82
83
84
# File 'cognito/user_pool_identity_provider_oidc_props.rb', line 82

def name
  @name
end

#scopesArray<String>? (readonly)

Note:

Default: ['openid']

The OAuth 2.0 scopes that you will request from OpenID Connect. Scopes are groups of OpenID Connect user attributes to exchange with your app.

Returns:

  • (Array<String>, nil)


87
88
89
# File 'cognito/user_pool_identity_provider_oidc_props.rb', line 87

def scopes
  @scopes
end

#user_poolAWSCDK::Cognito::IUserPool (readonly)

The user pool to which this construct provides identities.



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

def user_pool
  @user_pool
end

Class Method Details

.jsii_propertiesObject



89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'cognito/user_pool_identity_provider_oidc_props.rb', line 89

def self.jsii_properties
  {
    :user_pool => "userPool",
    :attribute_mapping => "attributeMapping",
    :client_id => "clientId",
    :client_secret => "clientSecret",
    :issuer_url => "issuerUrl",
    :attribute_request_method => "attributeRequestMethod",
    :endpoints => "endpoints",
    :identifiers => "identifiers",
    :name => "name",
    :scopes => "scopes",
  }
end

Instance Method Details

#to_jsiiObject



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'cognito/user_pool_identity_provider_oidc_props.rb', line 104

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "userPool" => @user_pool,
    "attributeMapping" => @attribute_mapping,
    "clientId" => @client_id,
    "clientSecret" => @client_secret,
    "issuerUrl" => @issuer_url,
    "attributeRequestMethod" => @attribute_request_method,
    "endpoints" => @endpoints,
    "identifiers" => @identifiers,
    "name" => @name,
    "scopes" => @scopes,
  })
  result.compact
end