Module: OIDCProvider::Concerns::Authentication
- Included in:
- ApplicationController
- Defined in:
- app/controllers/oidc_provider/concerns/authentication.rb
Instance Method Summary collapse
- #current_token ⇒ Object
- #oidc_current_account ⇒ Object
- #require_access_token ⇒ Object
- #require_authentication ⇒ Object
- #unauthenticate! ⇒ Object
Instance Method Details
#current_token ⇒ Object
8 9 10 |
# File 'app/controllers/oidc_provider/concerns/authentication.rb', line 8 def current_token @current_token ||= request.env[Rack::OAuth2::Server::Resource::ACCESS_TOKEN] end |
#oidc_current_account ⇒ Object
4 5 6 |
# File 'app/controllers/oidc_provider/concerns/authentication.rb', line 4 def oidc_current_account send(OIDCProvider.current_account_method) end |
#require_access_token ⇒ Object
16 17 18 19 20 |
# File 'app/controllers/oidc_provider/concerns/authentication.rb', line 16 def require_access_token unless current_token raise Rack::OAuth2::Server::Resource::Bearer::.new end end |
#require_authentication ⇒ Object
12 13 14 |
# File 'app/controllers/oidc_provider/concerns/authentication.rb', line 12 def require_authentication send(OIDCProvider.current_authentication_method) end |
#unauthenticate! ⇒ Object
22 23 24 |
# File 'app/controllers/oidc_provider/concerns/authentication.rb', line 22 def unauthenticate! send(OIDCProvider.current_unauthenticate_method) end |