aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Catalyst/Authentication/Credential/AccessToken.pm
diff options
context:
space:
mode:
authorM Somerville <matthew-github@dracos.co.uk>2020-08-07 20:02:17 +0100
committerM Somerville <matthew-github@dracos.co.uk>2020-08-11 14:00:46 +0100
commite461de75b26e74c0d8c154a1a17d6019c2be30dd (patch)
tree51c70d22931a7d34cddcf909d850d0af3397c48e /perllib/Catalyst/Authentication/Credential/AccessToken.pm
parentb4d322bf40f88dbab1717e7620178b3641ecd3fa (diff)
Offline process for CSV generation.
Include a status page, the option for access token requests to use this system, and a script for manual generation.
Diffstat (limited to 'perllib/Catalyst/Authentication/Credential/AccessToken.pm')
-rw-r--r--perllib/Catalyst/Authentication/Credential/AccessToken.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/perllib/Catalyst/Authentication/Credential/AccessToken.pm b/perllib/Catalyst/Authentication/Credential/AccessToken.pm
index 24398823d..39364ad99 100644
--- a/perllib/Catalyst/Authentication/Credential/AccessToken.pm
+++ b/perllib/Catalyst/Authentication/Credential/AccessToken.pm
@@ -15,12 +15,18 @@ sub new {
return $self;
}
-sub authenticate {
- my ( $self, $c, $realm, $authinfo_ignored ) = @_;
-
+sub get_token {
+ my ($self, $c) = @_;
my $auth_header = $c->req->header('Authorization') || '';
my ($token) = $auth_header =~ /^Bearer (.*)/i;
$token ||= $c->get_param('access_token');
+ return $token;
+}
+
+sub authenticate {
+ my ( $self, $c, $realm, $authinfo_ignored ) = @_;
+
+ my $token = $self->get_token($c);
return unless $token;
my $id;