Class: OauthIm::RequestClient
- Inherits:
-
Object
- Object
- OauthIm::RequestClient
- Defined in:
- app/services/oauth_im/request_client.rb
Instance Attribute Summary collapse
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#idp_url ⇒ Object
readonly
Returns the value of attribute idp_url.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(request:, client_id: nil, idp_url: nil) ⇒ RequestClient
constructor
A new instance of RequestClient.
- #login_url ⇒ Object
- #logout_url ⇒ Object
- #user_jwt ⇒ Object
Constructor Details
#initialize(request:, client_id: nil, idp_url: nil) ⇒ RequestClient
Returns a new instance of RequestClient.
15 16 17 18 19 20 21 |
# File 'app/services/oauth_im/request_client.rb', line 15 def initialize(request:, client_id: nil, idp_url: nil) @request = request @idp_url = idp_url || self.class.default_idp_url @client_id = client_id || self.class.default_client_id end |
Instance Attribute Details
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
5 6 7 |
# File 'app/services/oauth_im/request_client.rb', line 5 def client_id @client_id end |
#idp_url ⇒ Object (readonly)
Returns the value of attribute idp_url.
5 6 7 |
# File 'app/services/oauth_im/request_client.rb', line 5 def idp_url @idp_url end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
5 6 7 |
# File 'app/services/oauth_im/request_client.rb', line 5 def request @request end |
Class Method Details
.default_client_id ⇒ Object
11 12 13 |
# File 'app/services/oauth_im/request_client.rb', line 11 def self.default_client_id @default_client_id ||= OauthIm.configuration.client_id end |
.default_idp_url ⇒ Object
7 8 9 |
# File 'app/services/oauth_im/request_client.rb', line 7 def self.default_idp_url @default_idp_url ||= OauthIm.configuration.idp_url end |
Instance Method Details
#login_url ⇒ Object
23 24 25 |
# File 'app/services/oauth_im/request_client.rb', line 23 def login_url @login_url ||= auth_code. end |
#logout_url ⇒ Object
27 28 29 |
# File 'app/services/oauth_im/request_client.rb', line 27 def logout_url @logout_url ||= "#{idp_url}/oauth2/logout?client_id=#{client_id}" end |
#user_jwt ⇒ Object
31 32 33 |
# File 'app/services/oauth_im/request_client.rb', line 31 def user_jwt @user_jwt ||= { value: decoded_token, httponly: httponly? } end |