Exception: X::AuthorizationDenied
- Defined in:
- x-core/lib/x/core/errors/authorization_denied.rb
Overview
Error raised when the redirect back from X reports that the app was not authorized
X redirects the user back to the app with an error, rather than a code, when the user declines to authorize the app, or when X cannot ask them, and the redirect is refused when its state does not match the one the app sent, or when it is not a valid URL. The redirect is a request of the user's browser, not a response of X, so the error holds no response, and descends from Error directly; a refusal of X to exchange the code raises AuthorizationError, a ClientError that holds the response of X.
Instance Attribute Summary collapse
-
#error_code ⇒ String?
readonly
The OAuth 2.0 error code the redirect reported, such as access_denied.
Instance Method Summary collapse
-
#initialize(message = nil, error_code: nil) ⇒ AuthorizationDenied
constructor
Initialize a new AuthorizationDenied.
Constructor Details
#initialize(message = nil, error_code: nil) ⇒ AuthorizationDenied
Initialize a new AuthorizationDenied
50 51 52 53 |
# File 'x-core/lib/x/core/errors/authorization_denied.rb', line 50 def initialize( = nil, error_code: nil) super() @error_code = error_code end |
Instance Attribute Details
#error_code ⇒ String? (readonly)
The OAuth 2.0 error code the redirect reported, such as access_denied
23 24 25 |
# File 'x-core/lib/x/core/errors/authorization_denied.rb', line 23 def error_code @error_code end |