Store BrowserID verification answer in session (#584)

This commit is contained in:
Clément Oudot 2013-07-21 18:53:02 +00:00
parent ec0d1a61f0
commit 37756c3be2
2 changed files with 10 additions and 8 deletions

View File

@ -212,8 +212,7 @@ sub doubleIp {
$res .= "<li class=\"open\" id=\"di$ip\"><span>$ip</span><ul>";
# For each IP node, store sessions sorted by start time
foreach
my $session ( sort { $a->{startTime} <=> $b->{startTime} }
foreach my $session ( sort { $a->{startTime} <=> $b->{startTime} }
@{ $byUid->{$uid}->{$ip} } )
{
$res .=
@ -473,8 +472,9 @@ sub session {
'saml' => [
qw(_idp _idpConfKey _samlToken _lassoSessionDump _lassoIdentityDump)
],
'groups' => [qw(groups)],
'ldap' => [qw(dn)],
'groups' => [qw(groups)],
'ldap' => [qw(dn)],
'BrowserID' => [qw(_browserIdAnswer _browserIdAnswerRaw)],
};
# Display categories
@ -552,7 +552,7 @@ sub session {
foreach ( keys %session ) {
next if $_ !~ /^notification_(.+)/;
$res .=
'<li><strong>'
'<li><strong>'
. $1
. '</strong>: '
. $session{$_} . " ("

View File

@ -48,6 +48,8 @@ sub setAuthSessionInfo {
$self->{sessionInfo}->{_user} = $self->{user};
$self->{sessionInfo}->{authenticationLevel} = $self->{browserIdAuthnLevel};
$self->{sessionInfo}->{_browserIdAnswer} = $self->{browserIdAnswer};
$self->{sessionInfo}->{_browserIdAnswerRaw} = $self->{browserIdAnswerRaw};
PE_OK;
}
@ -89,14 +91,14 @@ sub extractFormInfo {
if ( $answer->code() == "200" ) {
# Get JSON answser
my $browserIdVerificationAnswer = $answer->content;
$self->{browserIdAnswerRaw} = $answer->content;
$self->lmLog(
"Received BrowserID answer: $browserIdVerificationAnswer",
"Received BrowserID answer: " . $self->{browserIdAnswerRaw},
'debug' );
my $json = new JSON();
$self->{browserIdAnswer} =
$json->decode($browserIdVerificationAnswer);
$json->decode( $self->{browserIdAnswerRaw} );
if ( $self->{browserIdAnswer}->{status} eq "okay" ) {
$self->{user} = $self->{browserIdAnswer}->{email};