Class: AWSCDK::Cognito::OAuthFlows

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cognito/o_auth_flows.rb

Overview

Types of OAuth grant flows.

See Also:

  • the 'Allowed OAuth Flows' section at https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-app-idp-settings.html

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authorization_code_grant: nil, client_credentials: nil, implicit_code_grant: nil) ⇒ OAuthFlows

Returns a new instance of OAuthFlows.

Parameters:

  • authorization_code_grant (Boolean, nil) (defaults to: nil)

    Initiate an authorization code grant flow, which provides an authorization code as the response.

  • client_credentials (Boolean, nil) (defaults to: nil)

    Client should get the access token and ID token from the token endpoint using a combination of client and client_secret.

  • implicit_code_grant (Boolean, nil) (defaults to: nil)

    The client should get the access token and ID token directly.



12
13
14
15
16
17
18
19
# File 'cognito/o_auth_flows.rb', line 12

def initialize(authorization_code_grant: nil, client_credentials: nil, implicit_code_grant: nil)
  @authorization_code_grant = authorization_code_grant
  Jsii::Type.check_type(@authorization_code_grant, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "authorizationCodeGrant") unless @authorization_code_grant.nil?
  @client_credentials = client_credentials
  Jsii::Type.check_type(@client_credentials, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "clientCredentials") unless @client_credentials.nil?
  @implicit_code_grant = implicit_code_grant
  Jsii::Type.check_type(@implicit_code_grant, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "implicitCodeGrant") unless @implicit_code_grant.nil?
end

Instance Attribute Details

#authorization_code_grantBoolean? (readonly)

Note:

Default: false

Initiate an authorization code grant flow, which provides an authorization code as the response.

Returns:

  • (Boolean, nil)


25
26
27
# File 'cognito/o_auth_flows.rb', line 25

def authorization_code_grant
  @authorization_code_grant
end

#client_credentialsBoolean? (readonly)

Note:

Default: false

Client should get the access token and ID token from the token endpoint using a combination of client and client_secret.

Returns:

  • (Boolean, nil)


30
31
32
# File 'cognito/o_auth_flows.rb', line 30

def client_credentials
  @client_credentials
end

#implicit_code_grantBoolean? (readonly)

Note:

Default: false

The client should get the access token and ID token directly.

Returns:

  • (Boolean, nil)


35
36
37
# File 'cognito/o_auth_flows.rb', line 35

def implicit_code_grant
  @implicit_code_grant
end

Class Method Details

.jsii_propertiesObject



37
38
39
40
41
42
43
# File 'cognito/o_auth_flows.rb', line 37

def self.jsii_properties
  {
    :authorization_code_grant => "authorizationCodeGrant",
    :client_credentials => "clientCredentials",
    :implicit_code_grant => "implicitCodeGrant",
  }
end

Instance Method Details

#to_jsiiObject



45
46
47
48
49
50
51
52
53
# File 'cognito/o_auth_flows.rb', line 45

def to_jsii
  result = {}
  result.merge!({
    "authorizationCodeGrant" => @authorization_code_grant,
    "clientCredentials" => @client_credentials,
    "implicitCodeGrant" => @implicit_code_grant,
  })
  result.compact
end