Class: AWSCDK::Cognito::OAuthSettings
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Cognito::OAuthSettings
- Defined in:
- cognito/o_auth_settings.rb
Overview
OAuth settings to configure the interaction between the app and this client.
Instance Attribute Summary collapse
-
#callback_urls ⇒ Array<String>?
readonly
List of allowed redirect URLs for the identity providers.
-
#default_redirect_uri ⇒ String?
readonly
The default redirect URI.
-
#flows ⇒ AWSCDK::Cognito::OAuthFlows?
readonly
OAuth flows that are allowed with this client.
-
#logout_urls ⇒ Array<String>?
readonly
List of allowed logout URLs for the identity providers.
-
#scopes ⇒ Array<AWSCDK::Cognito::OAuthScope>?
readonly
OAuth scopes that are allowed with this client.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(callback_urls: nil, default_redirect_uri: nil, flows: nil, logout_urls: nil, scopes: nil) ⇒ OAuthSettings
constructor
A new instance of OAuthSettings.
- #to_jsii ⇒ Object
Constructor Details
#initialize(callback_urls: nil, default_redirect_uri: nil, flows: nil, logout_urls: nil, scopes: nil) ⇒ OAuthSettings
Returns a new instance of OAuthSettings.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'cognito/o_auth_settings.rb', line 12 def initialize(callback_urls: nil, default_redirect_uri: nil, flows: nil, logout_urls: nil, scopes: nil) @callback_urls = callback_urls Jsii::Type.check_type(@callback_urls, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "callbackUrls") unless @callback_urls.nil? @default_redirect_uri = default_redirect_uri Jsii::Type.check_type(@default_redirect_uri, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "defaultRedirectUri") unless @default_redirect_uri.nil? @flows = flows.is_a?(Hash) ? ::AWSCDK::Cognito::OAuthFlows.new(**flows.transform_keys(&:to_sym)) : flows Jsii::Type.check_type(@flows, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29nbml0by5PQXV0aEZsb3dzIn0=")), "flows") unless @flows.nil? @logout_urls = logout_urls Jsii::Type.check_type(@logout_urls, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "logoutUrls") unless @logout_urls.nil? @scopes = scopes Jsii::Type.check_type(@scopes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2duaXRvLk9BdXRoU2NvcGUifSwia2luZCI6ImFycmF5In19")), "scopes") unless @scopes.nil? end |
Instance Attribute Details
#callback_urls ⇒ Array<String>? (readonly)
Default: - ['https://example.com'] if either authorizationCodeGrant or implicitCodeGrant flows are enabled, no callback URLs otherwise.
List of allowed redirect URLs for the identity providers.
29 30 31 |
# File 'cognito/o_auth_settings.rb', line 29 def callback_urls @callback_urls end |
#default_redirect_uri ⇒ String? (readonly)
Default: - no default redirect URI
The default redirect URI. Must be in the callbackUrls list.
A redirect URI must:
- Be an absolute URI
- Be registered with the authorization server.
- Not include a fragment component.
41 42 43 |
# File 'cognito/o_auth_settings.rb', line 41 def default_redirect_uri @default_redirect_uri end |
#flows ⇒ AWSCDK::Cognito::OAuthFlows? (readonly)
Default: authorizationCodeGrant:true,implicitCodeGrant:true
OAuth flows that are allowed with this client.
47 48 49 |
# File 'cognito/o_auth_settings.rb', line 47 def flows @flows end |
#logout_urls ⇒ Array<String>? (readonly)
Default: - no logout URLs
List of allowed logout URLs for the identity providers.
52 53 54 |
# File 'cognito/o_auth_settings.rb', line 52 def logout_urls @logout_urls end |
#scopes ⇒ Array<AWSCDK::Cognito::OAuthScope>? (readonly)
Default: [OAuthScope.PHONE,OAuthScope.EMAIL,OAuthScope.OPENID,OAuthScope.PROFILE,OAuthScope.COGNITO_ADMIN]
OAuth scopes that are allowed with this client.
58 59 60 |
# File 'cognito/o_auth_settings.rb', line 58 def scopes @scopes end |
Class Method Details
.jsii_properties ⇒ Object
60 61 62 63 64 65 66 67 68 |
# File 'cognito/o_auth_settings.rb', line 60 def self.jsii_properties { :callback_urls => "callbackUrls", :default_redirect_uri => "defaultRedirectUri", :flows => "flows", :logout_urls => "logoutUrls", :scopes => "scopes", } end |
Instance Method Details
#to_jsii ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 |
# File 'cognito/o_auth_settings.rb', line 70 def to_jsii result = {} result.merge!({ "callbackUrls" => @callback_urls, "defaultRedirectUri" => @default_redirect_uri, "flows" => @flows, "logoutUrls" => @logout_urls, "scopes" => @scopes, }) result.compact end |