Class: RailsIam::Authentication::BearerExtractor
- Inherits:
-
RailsIamService
- Object
- ApplicationService
- RailsIamService
- RailsIam::Authentication::BearerExtractor
- Defined in:
- app/services/rails_iam/authentication/token_extractor.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(request) ⇒ BearerExtractor
constructor
A new instance of BearerExtractor.
Methods inherited from RailsIamService
Methods included from ConfigLoader
#authentication_strategies, #authorization_rule_error, #cookie_options, #jwt_algorithm, #jwt_audience, #jwt_expiry, #jwt_issuer, #jwt_secret_key, #refresh_token_transport, #session_strategy, #user_class
Constructor Details
#initialize(request) ⇒ BearerExtractor
Returns a new instance of BearerExtractor.
21 22 23 24 |
# File 'app/services/rails_iam/authentication/token_extractor.rb', line 21 def initialize(request) super() @request = request end |
Instance Method Details
#call ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'app/services/rails_iam/authentication/token_extractor.rb', line 26 def call = request.headers["Authorization"] return if .blank? scheme, token = .split(" ", 2) scheme == "Bearer" ? token : nil end |