Class: FIS::Auth::Client
- Inherits:
-
Object
- Object
- FIS::Auth::Client
- Defined in:
- lib/fis/auth/client.rb
Overview
OAuth2 + PKCE helper class for authenticating against portal.flatironschool.com
Constant Summary collapse
- CODE_CHALLENGE_METHOD =
'S256'
Instance Method Summary collapse
- #authorize_url ⇒ Object
- #get_token(code:) ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
12 13 14 15 16 17 18 19 |
# File 'lib/fis/auth/client.rb', line 12 def initialize @client = OAuth2::Client.new( Auth::CLIENT_ID, nil, site: Auth::PROVIDER_URL, redirect_uri: Auth::REDIRECT_URI ) end |
Instance Method Details
#authorize_url ⇒ Object
21 22 23 24 25 26 |
# File 'lib/fis/auth/client.rb', line 21 def @client.auth_code.( code_challenge: code_challenge, code_challenge_method: CODE_CHALLENGE_METHOD ) end |
#get_token(code:) ⇒ Object
28 29 30 |
# File 'lib/fis/auth/client.rb', line 28 def get_token(code:) @client.auth_code.get_token(code, code_verifier: code_verifier) end |