Exception: MCP::Server::OAuth::Error
- Inherits:
-
StandardError
- Object
- StandardError
- MCP::Server::OAuth::Error
- Defined in:
- lib/mcp/server/oauth/errors.rb
Overview
Error hierarchy for the OAuth 2.1 resource-server role. Each error carries the RFC 6750 Section 3.1
registered error code that Challenge places in the WWW-Authenticate response header.
https://www.rfc-editor.org/rfc/rfc6750#section-3.1
Direct Known Subclasses
InsufficientScopeError, InvalidRequestError, InvalidTokenError
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
Instance Method Summary collapse
-
#initialize(message = nil, error_code: "invalid_token") ⇒ Error
constructor
error_codedefaults to the code a token rejection carries, so a custom verifier can subclass this andraise MyError, "..."without knowing about the keyword.
Constructor Details
#initialize(message = nil, error_code: "invalid_token") ⇒ Error
error_code defaults to the code a token rejection carries, so a custom verifier can subclass this
and raise MyError, "..." without knowing about the keyword. Authenticator#challenge_response
answers any such error with 401 invalid_token, which is what the default names; without a default,
the missing keyword would raise ArgumentError inside verify and surface as HTTP 500 instead.
16 17 18 19 |
# File 'lib/mcp/server/oauth/errors.rb', line 16 def initialize( = nil, error_code: "invalid_token") super() @error_code = error_code end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
10 11 12 |
# File 'lib/mcp/server/oauth/errors.rb', line 10 def error_code @error_code end |