-
-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Brent] Allow different OIDC config for WasteWorks host
For FD-3395
- Loading branch information
Showing
5 changed files
with
93 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,6 +135,53 @@ for my $test ( | |
report_email => $test_email3, | ||
pc => 'HA9 0FJ', | ||
}, | ||
{ | ||
type => 'oidc', | ||
config => { | ||
ALLOWED_COBRANDS => 'brent', | ||
MAPIT_URL => 'http://mapit.uk/', | ||
COBRAND_FEATURES => { | ||
anonymous_account => { | ||
brent => 'test', | ||
}, | ||
oidc_login => { | ||
brent => { | ||
client_id => 'example_client_id', | ||
secret => 'example_secret_key', | ||
auth_uri => 'http://oidc.example.org/oauth2/v2.0/authorize', | ||
token_uri => 'http://oidc.example.org/oauth2/v2.0/token', | ||
logout_uri => 'http://oidc.example.org/oauth2/v2.0/logout', | ||
password_change_uri => 'http://oidc.example.org/oauth2/v2.0/password_change', | ||
display_name => 'MyAccount', | ||
hosts => { | ||
'brent-wasteworks-oidc.example.org' => { | ||
client_id => 'wasteworks_client_id', | ||
secret => 'wasteworks_secret_key', | ||
auth_uri => 'http://brent-wasteworks-oidc.example.org/oauth2/v2.0/authorize', | ||
token_uri => 'http://brent-wasteworks-oidc.example.org/oauth2/v2.0/token', | ||
logout_uri => 'http://brent-wasteworks-oidc.example.org/oauth2/v2.0/logout', | ||
password_change_uri => 'http://brent-wasteworks-oidc.example.org/oauth2/v2.0/password_change', | ||
display_name => 'MyAccount - WasteWorks', | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
email => $mech->uniquify_email('[email protected]'), | ||
uid => "brent:wasteworks_client_id:my_cool_user_id", | ||
mock => 't::Mock::OpenIDConnect', | ||
mock_hosts => ['brent-wasteworks-oidc.example.org'], | ||
host => 'brent-wasteworks-oidc.example.org', | ||
error_callback => '/auth/OIDC?error=ERROR', | ||
success_callback => '/auth/OIDC?code=response-code&state=login', | ||
redirect_pattern => qr{brent-wasteworks-oidc\.example\.org/oauth2/v2\.0/authorize}, | ||
logout_redirect_pattern => qr{brent-wasteworks-oidc\.example\.org/oauth2/v2\.0/logout}, | ||
password_change_pattern => qr{brent-wasteworks-oidc\.example\.org/oauth2/v2\.0/password_change}, | ||
report => $report3, | ||
report_email => $test_email3, | ||
pc => 'HA9 0FJ', | ||
}, | ||
{ | ||
type => 'oidc', | ||
config => { | ||
|
@@ -207,7 +254,7 @@ for my $state ( 'refused', 'no email', 'existing UID', 'okay' ) { | |
} | ||
|
||
# Set up a mock to catch (most, see below) requests to the OAuth API | ||
my $mock_api = $test->{mock}->new; | ||
my $mock_api = $test->{mock}->new( host => $test->{host} ); | ||
|
||
if ($test->{uid} =~ /:/) { | ||
my ($cobrand) = $test->{uid} =~ /^(.*?):/; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters