Class: Stormpath::Rails::ControllerAuthentication::FromBearerAuth
- Inherits:
-
Object
- Object
- Stormpath::Rails::ControllerAuthentication::FromBearerAuth
- Defined in:
- app/services/stormpath/rails/controller_authentication/from_bearer_auth.rb
Constant Summary collapse
- RESCUE_CLASSES =
[ Stormpath::Oauth::Error, JWT::DecodeError, AccountFromAccessToken::AuthenticationWithRefreshTokenAttemptError, AccountFromAccessToken::DifferentIssuerError ].freeze
Instance Attribute Summary collapse
-
#authorization_header ⇒ Object
readonly
Returns the value of attribute authorization_header.
Instance Method Summary collapse
- #authenticate! ⇒ Object
-
#initialize(authorization_header) ⇒ FromBearerAuth
constructor
A new instance of FromBearerAuth.
Constructor Details
#initialize(authorization_header) ⇒ FromBearerAuth
Returns a new instance of FromBearerAuth.
14 15 16 |
# File 'app/services/stormpath/rails/controller_authentication/from_bearer_auth.rb', line 14 def initialize() = end |
Instance Attribute Details
#authorization_header ⇒ Object (readonly)
Returns the value of attribute authorization_header.
5 6 7 |
# File 'app/services/stormpath/rails/controller_authentication/from_bearer_auth.rb', line 5 def end |
Instance Method Details
#authenticate! ⇒ Object
18 19 20 21 22 23 24 |
# File 'app/services/stormpath/rails/controller_authentication/from_bearer_auth.rb', line 18 def authenticate! begin AccountFromAccessToken.new(bearer_access_token).account rescue *RESCUE_CLASSES raise UnauthenticatedRequest end end |