Mercurial > prosody-modules
annotate mod_lib_ldap/dev/t/00-login.t @ 5255:001c8fdc91a4
mod_http_oauth2: Add support for the "openid" scope
This "openid" scope is there to signal access to the userinfo endpoint,
which is needed for OIDC support.
We don't actually check this later because the userinfo endpoint only
returns info embedded in the token itself, but in the future we may want
to check this more carefully.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 16 Mar 2023 17:06:35 +0100 |
parents | 512e31cd8b70 |
children |
rev | line source |
---|---|
809 | 1 use strict; |
2 use warnings; | |
3 use lib 't'; | |
4 | |
5 use TestConnection; | |
6 use Test::More; | |
7 | |
8 my @users = ( | |
9 'one', | |
10 'two', | |
11 'three', | |
12 'four', | |
13 'five', | |
866 | 14 'six', |
809 | 15 ); |
16 | |
874 | 17 plan tests => scalar(@users) + 3; |
809 | 18 |
19 foreach my $username (@users) { | |
20 my $conn = TestConnection->new($username); | |
21 | |
22 $conn->reg_cb(session_ready => sub { | |
23 $conn->cond->send; | |
24 }); | |
25 | |
26 my $error = $conn->cond->recv; | |
867
a93cb608db2c
Print the username if a test login fails
Rob Hoelz <rob@hoelz.ro>
parents:
866
diff
changeset
|
27 ok(! $error) or diag("$username login failed: $error"); |
809 | 28 } |
29 | |
30 do { | |
31 my $conn = TestConnection->new('one', password => '23451'); | |
32 | |
33 $conn->reg_cb(session_ready => sub { | |
34 $conn->cond->send; | |
35 }); | |
36 | |
37 my $error = $conn->cond->recv; | |
38 ok($error); | |
39 }; | |
40 | |
41 do { | |
876
512e31cd8b70
Fix login failure test to use a non-existent user
Rob Hoelz <rob@hoelz.ro>
parents:
874
diff
changeset
|
42 my $conn = TestConnection->new('invalid', password => '12345'); |
809 | 43 |
44 $conn->reg_cb(session_ready => sub { | |
45 $conn->cond->send; | |
46 }); | |
47 | |
48 my $error = $conn->cond->recv; | |
49 ok($error); | |
50 }; | |
874 | 51 |
52 do { | |
53 my $conn = TestConnection->new('seven', password => '1234567'); | |
54 | |
55 $conn->reg_cb(session_ready => sub { | |
56 $conn->cond->send; | |
57 }); | |
58 | |
59 my $error = $conn->cond->recv; | |
60 ok($error); | |
61 }; |