| 1 | package Catalyst::Plugin::OAuth2::ResourceServer::Error; | ||
| 2 | 6 | ▶ | use v5.36; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 6 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 6 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 6 | our $VERSION = '0.003'; | |
| 7 | |||
| 8 | 6 | has error => ( is => 'ro' ); # optional: a bare challenge has none | |
| 9 | 6 | has error_description => ( is => 'ro' ); | |
| 10 | 6 | has scope => ( is => 'ro' ); # for insufficient_scope | |
| 11 | 6 | has http_status => ( is => 'ro', default => 401 ); | |
| 12 | |||
| 13 | 18 | ▶ | sub throw ( $class, %args ) { |
|
Subroutine
throw: called CC=1 SCAR=0.0
Pod
documented
| |||
| 14 | 18 | die $class->new(%args); | |
| 15 | } | ||
| 16 | |||
| 17 | =head1 NAME | ||
| 18 | |||
| 19 | Catalyst::Plugin::OAuth2::ResourceServer::Error - a Bearer-challenge error | ||
| 20 | |||
| 21 | =head1 DESCRIPTION | ||
| 22 | |||
| 23 | Thrown by the engine/seam to signal a bearer-auth failure. Attributes: C<error> | ||
| 24 | (optional RFC 6750 code, one of C<invalid_token> / C<insufficient_scope> / | ||
| 25 | C<invalid_request>; absent for a plain challenge), C<error_description>, | ||
| 26 | C<scope> (echoed on C<insufficient_scope>), C<http_status> (default 401). The | ||
| 27 | seam turns one of these into a C<WWW-Authenticate: Bearer ...> response. | ||
| 28 | |||
| 29 | =head1 METHODS | ||
| 30 | |||
| 31 | =head2 throw( error => $code, ... ) | ||
| 32 | |||
| 33 | Construct and C<die> a new instance. | ||
| 34 | |||
| 35 | =cut | ||
| 36 | |||
| 37 | 6 | 1; | |