summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Auth.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-08-27 05:54:32 +0200
committerDave Lawrence <dlawrence@mozilla.com>2013-08-27 05:54:32 +0200
commit7450b47683d0aa972a522f5b70353e14269a95e6 (patch)
tree1c7908ede712092ac91b1508079e0b8dfebf67ec /Bugzilla/Auth.pm
parent95aadcd21c9a56ef7d3478a2504980ea44f1bd9c (diff)
downloadbugzilla-7450b47683d0aa972a522f5b70353e14269a95e6.tar.gz
bugzilla-7450b47683d0aa972a522f5b70353e14269a95e6.tar.xz
Bug 893195 - Allow token based authentication for webservices
r=glob,a=sgreen
Diffstat (limited to 'Bugzilla/Auth.pm')
-rw-r--r--Bugzilla/Auth.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/Bugzilla/Auth.pm b/Bugzilla/Auth.pm
index 412edd5a1..c46e554a3 100644
--- a/Bugzilla/Auth.pm
+++ b/Bugzilla/Auth.pm
@@ -109,6 +109,15 @@ sub can_logout {
return $getter->can_logout;
}
+sub login_token {
+ my ($self) = @_;
+ my $getter = $self->{_info_getter}->{successful};
+ if ($getter && $getter->isa('Bugzilla::Auth::Login::Cookie')) {
+ return $getter->login_token;
+ }
+ return undef;
+}
+
sub user_can_create_account {
my ($self) = @_;
my $verifier = $self->{_verifier}->{successful};
@@ -410,6 +419,14 @@ Params: None
Returns: C<true> if users can change their own email address,
C<false> otherwise.
+=item C<login_token>
+
+Description: If a login token was used instead of a cookie then this
+ will return the current login token data such as user id
+ and the token itself.
+Params: None
+Returns: A hash containing C<login_token> and C<user_id>.
+
=back
=head1 STRUCTURE