Class: OmniAuth::Strategies::Canvas
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Canvas
- Defined in:
- lib/omniauth/strategies/canvas.rb
Instance Method Summary collapse
-
#authorize_params ⇒ Object
Override authorize_params so that we can be deliberate about the value for state and not use the session which is unavailable inside of an iframe for some browsers (ie Safari).
-
#query_string ⇒ Object
Passing any query string value to Canvas will result in: redirect_uri does not match client settings so we set the value to empty string.
- #raw_info ⇒ Object
Instance Method Details
#authorize_params ⇒ Object
Override authorize_params so that we can be deliberate about the value for state and not use the session which is unavailable inside of an iframe for some browsers (ie Safari)
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/omniauth/strategies/canvas.rb', line 55 def # Only set state if it hasn't already been set .[:state] ||= SecureRandom.hex(24) params = ..merge(("authorize")) if OmniAuth.config.test_mode @env ||= {} @env["rack.session"] ||= {} end params end |
#query_string ⇒ Object
Passing any query string value to Canvas will result in: redirect_uri does not match client settings so we set the value to empty string
48 49 50 |
# File 'lib/omniauth/strategies/canvas.rb', line 48 def query_string "" end |
#raw_info ⇒ Object
41 42 43 |
# File 'lib/omniauth/strategies/canvas.rb', line 41 def raw_info @raw_info ||= access_token.get("/api/v1/users/#{access_token['user']['id']}/profile").parsed end |