Module: OIDCProvider::Concerns::Authentication
- Included in:
- ApplicationController
- Defined in:
- app/controllers/oidc_provider/concerns/authentication.rb
Instance Method Summary collapse
- #current_account ⇒ Object
- #current_token ⇒ Object
- #require_access_token ⇒ Object
- #require_authentication ⇒ Object
Instance Method Details
#current_account ⇒ Object
4 5 6 |
# File 'app/controllers/oidc_provider/concerns/authentication.rb', line 4 def current_account send(OIDCProvider.current_account_method) end |
#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 |
#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::Unauthorized.new end end |
#require_authentication ⇒ Object
12 13 14 |
# File 'app/controllers/oidc_provider/concerns/authentication.rb', line 12 def require_authentication authenticate_user! end |