Class: CognitoIdp::AuthorizationUri
- Inherits:
-
Object
- Object
- CognitoIdp::AuthorizationUri
- Defined in:
- lib/cognito_idp/authorization_uri.rb
Instance Attribute Summary collapse
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#code_challenge ⇒ Object
Returns the value of attribute code_challenge.
-
#code_challenge_method ⇒ Object
Returns the value of attribute code_challenge_method.
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#identity_provider ⇒ Object
Returns the value of attribute identity_provider.
-
#idp_identifier ⇒ Object
Returns the value of attribute idp_identifier.
-
#nonce ⇒ Object
Returns the value of attribute nonce.
-
#redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
-
#response_type ⇒ Object
Returns the value of attribute response_type.
-
#scope ⇒ Object
Returns the value of attribute scope.
-
#state ⇒ Object
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(client_id:, domain:, redirect_uri:, response_type: :code, **options) ⇒ AuthorizationUri
constructor
A new instance of AuthorizationUri.
- #to_s ⇒ Object
Constructor Details
#initialize(client_id:, domain:, redirect_uri:, response_type: :code, **options) ⇒ AuthorizationUri
Returns a new instance of AuthorizationUri.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/cognito_idp/authorization_uri.rb', line 9 def initialize(client_id:, domain:, redirect_uri:, response_type: :code, **) @code_challenge_method = [:code_challenge_method] @code_challenge = [:code_challenge] @client_id = client_id @domain = domain @identity_provider = [:identity_provider] @idp_identifier = [:idp_identifier] @nonce = [:nonce] @redirect_uri = redirect_uri @response_type = response_type @scope = [:scope] @state = [:state] end |
Instance Attribute Details
#client_id ⇒ Object
Returns the value of attribute client_id.
5 6 7 |
# File 'lib/cognito_idp/authorization_uri.rb', line 5 def client_id @client_id end |
#code_challenge ⇒ Object
Returns the value of attribute code_challenge.
5 6 7 |
# File 'lib/cognito_idp/authorization_uri.rb', line 5 def code_challenge @code_challenge end |
#code_challenge_method ⇒ Object
Returns the value of attribute code_challenge_method.
5 6 7 |
# File 'lib/cognito_idp/authorization_uri.rb', line 5 def code_challenge_method @code_challenge_method end |
#domain ⇒ Object
Returns the value of attribute domain.
5 6 7 |
# File 'lib/cognito_idp/authorization_uri.rb', line 5 def domain @domain end |
#identity_provider ⇒ Object
Returns the value of attribute identity_provider.
5 6 7 |
# File 'lib/cognito_idp/authorization_uri.rb', line 5 def identity_provider @identity_provider end |
#idp_identifier ⇒ Object
Returns the value of attribute idp_identifier.
5 6 7 |
# File 'lib/cognito_idp/authorization_uri.rb', line 5 def idp_identifier @idp_identifier end |
#nonce ⇒ Object
Returns the value of attribute nonce.
5 6 7 |
# File 'lib/cognito_idp/authorization_uri.rb', line 5 def nonce @nonce end |
#redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
5 6 7 |
# File 'lib/cognito_idp/authorization_uri.rb', line 5 def redirect_uri @redirect_uri end |
#response_type ⇒ Object
Returns the value of attribute response_type.
5 6 7 |
# File 'lib/cognito_idp/authorization_uri.rb', line 5 def response_type @response_type end |
#scope ⇒ Object
Returns the value of attribute scope.
5 6 7 |
# File 'lib/cognito_idp/authorization_uri.rb', line 5 def scope @scope end |
#state ⇒ Object
Returns the value of attribute state.
5 6 7 |
# File 'lib/cognito_idp/authorization_uri.rb', line 5 def state @state end |
Instance Method Details
#to_s ⇒ Object
23 24 25 26 27 |
# File 'lib/cognito_idp/authorization_uri.rb', line 23 def to_s URI("https://#{domain}/oauth2/authorize").tap do |uri| uri.query = URI.encode_www_form(params) end.to_s end |