From 240077ef7e91afb8cc89866c06fa2ca39d6a0c03 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Mon, 7 Jan 2013 16:05:19 -0500 Subject: Bug 820183 - BrowserID extension should allow custom configuration of browserid hostnames to use for verification r=glob --- extensions/BrowserID/lib/Config.pm | 35 +++++++++++++++++++++++++++++++++++ extensions/BrowserID/lib/Login.pm | 4 ++-- 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 extensions/BrowserID/lib/Config.pm (limited to 'extensions/BrowserID/lib') diff --git a/extensions/BrowserID/lib/Config.pm b/extensions/BrowserID/lib/Config.pm new file mode 100644 index 000000000..9d47e52e2 --- /dev/null +++ b/extensions/BrowserID/lib/Config.pm @@ -0,0 +1,35 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. +package Bugzilla::Extension::BrowserID::Config; + +use strict; +use warnings; + +use Bugzilla::Config::Common; + +our $sortkey = 1350; + +sub get_param_list { + my ($class) = @_; + + my @param_list = ( + { + name => 'browserid_verify_url', + type => 't', + default => 'https://browserid.org/verify', + }, + { + name => 'browserid_includejs_url', + type => 't', + default => 'https://browserid.org/include.js', + } + ); + + return @param_list; +} + +1; diff --git a/extensions/BrowserID/lib/Login.pm b/extensions/BrowserID/lib/Login.pm index c3d87c958..d87c6f15c 100644 --- a/extensions/BrowserID/lib/Login.pm +++ b/extensions/BrowserID/lib/Login.pm @@ -45,7 +45,7 @@ sub get_login_info { # in the page. $cgi->delete('browserid_assertion'); - if (!$assertion) { + if (!$assertion || !Bugzilla->params->{browserid_verify_url}) { return { failure => AUTH_NODATA }; } @@ -60,7 +60,7 @@ sub get_login_info { my $info = { 'status' => 'browserid-server-broken' }; eval { - my $response = $ua->post("https://browserid.org/verify", + my $response = $ua->post(Bugzilla->params->{browserid_verify_url}, [assertion => $assertion, audience => $audience]); -- cgit v1.2.3-24-g4f1b