Commit 90352f51 authored by Yadd's avatar Yadd
Browse files

More OIDC tests (#595)

parent 8b010447
......@@ -168,7 +168,6 @@ ok(
count(1);
expectRedirection( $res, qr#^http://auth.op.com/oauth2/authorize# );
#print STDERR Dumper($res);
#print STDERR Dumper($res);
clean_sessions();
......
......@@ -84,7 +84,16 @@ ok( $prms{state}, ' state found' );
ok( $prms{session_state}, ' session_state found' );
count(6);
#print STDERR Dumper($query);
my $at;
ok( $at = $rp->p->_userDB->getUserInfo( 'op', $prms{access_token} ),
'Get access token' );
ok( $at = JSON::from_json($at), ' Decode JSON' );
ok( $at->{name} eq 'Doctor Who', ' Get name' );
ok( $at->{family_name} eq 'Doctor Who', ' Get family_name' );
ok( $at->{sub} eq 'dwho', ' Get sub' );
count(5);
#print STDERR Dumper($at);
clean_sessions();
done_testing( count() );
......
......@@ -223,6 +223,8 @@ has app => (
isa => 'CodeRef',
);
has p => ( is => 'rw' );
has ini => (
is => 'rw',
default => sub { $defaultIni; },
......@@ -232,9 +234,11 @@ has ini => (
$ini->{$k} //= $defaultIni->{$k};
}
$self->{ini} = $ini;
main::ok( $self->{app} = Lemonldap::NG::Portal::Main->run($ini),
main::ok($self->{p} = Lemonldap::NG::Portal::Main->new(),'Portal object');
main::ok($self->{p}->init($ini),'Init');
main::ok( $self->{app} = $self->{p}->run(),
'Portal app' );
main::count(1);
main::count(3);
$self;
}
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment