Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
LemonLDAP NG
lemonldap-ng
Commits
a09af344
Commit
a09af344
authored
Oct 31, 2017
by
Yadd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Missing $req in updatePersistentSession calls (fixes: #1319)
parent
42148200
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
8 deletions
+36
-8
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/OpenID.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/OpenID.pm
+2
-2
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/OpenIDConnect.pm
...ng-portal/lib/Lemonldap/NG/Portal/Issuer/OpenIDConnect.pm
+4
-2
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/SAML.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/SAML.pm
+1
-1
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/OpenID/SREG.pm
...ldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/OpenID/SREG.pm
+2
-2
lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code.t
...-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code.t
+27
-1
No files found.
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/OpenID.pm
View file @
a09af344
...
@@ -162,12 +162,12 @@ sub openIDServer {
...
@@ -162,12 +162,12 @@ sub openIDServer {
return
1
;
return
1
;
}
}
elsif
(
$req
->
param
("
confirm
")
and
$req
->
param
("
confirm
")
==
1
)
{
elsif
(
$req
->
param
("
confirm
")
and
$req
->
param
("
confirm
")
==
1
)
{
$self
->
p
->
updatePersistentSession
(
$self
->
p
->
updatePersistentSession
(
$req
,
{
"
_openidTrust
$trust_root
"
=>
1
}
);
{
"
_openidTrust
$trust_root
"
=>
1
}
);
return
1
;
return
1
;
}
}
elsif
(
$req
->
param
("
confirm
")
and
$req
->
param
("
confirm
")
==
-
1
)
{
elsif
(
$req
->
param
("
confirm
")
and
$req
->
param
("
confirm
")
==
-
1
)
{
$self
->
p
->
updatePersistentSession
(
$self
->
p
->
updatePersistentSession
(
$req
,
{
"
_openidTrust
$trust_root
"
=>
0
}
);
{
"
_openidTrust
$trust_root
"
=>
0
}
);
return
0
;
return
0
;
}
}
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/OpenIDConnect.pm
View file @
a09af344
...
@@ -384,15 +384,17 @@ sub run {
...
@@ -384,15 +384,17 @@ sub run {
}
}
# Check prompt parameter
# Check prompt parameter
$ask_for_consent
=
1
if
(
$prompt
=~
/\bconsent\b/
);
$ask_for_consent
=
1
if
(
$prompt
and
$prompt
=~
/\bconsent\b/
);
}
}
if
(
$ask_for_consent
)
{
if
(
$ask_for_consent
)
{
if
(
$req
->
param
('
confirm
')
if
(
$req
->
param
('
confirm
')
and
$req
->
param
('
confirm
')
==
1
)
and
$req
->
param
('
confirm
')
==
1
)
{
{
$self
->
p
->
updatePersistentSession
(
$self
->
p
->
updatePersistentSession
(
$req
,
{
"
_oidc_consent_time_
$rp
"
=>
time
}
);
{
"
_oidc_consent_time_
$rp
"
=>
time
}
);
$self
->
p
->
updatePersistentSession
(
$self
->
p
->
updatePersistentSession
(
$req
,
{
{
"
_oidc_consent_scope_
$rp
"
=>
"
_oidc_consent_scope_
$rp
"
=>
$oidc_request
->
{'
scope
'}
$oidc_request
->
{'
scope
'}
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/SAML.pm
View file @
a09af344
...
@@ -793,7 +793,7 @@ sub run {
...
@@ -793,7 +793,7 @@ sub run {
# Update session
# Update session
$self
->
logger
->
debug
("
Save Lasso identity in session
");
$self
->
logger
->
debug
("
Save Lasso identity in session
");
$self
->
updatePersistentSession
(
$self
->
updatePersistentSession
(
$req
,
{
_lassoIdentityDump
=>
$login
->
get_identity
->
dump
},
{
_lassoIdentityDump
=>
$login
->
get_identity
->
dump
},
undef
,
$session_id
);
undef
,
$session_id
);
}
}
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/OpenID/SREG.pm
View file @
a09af344
...
@@ -24,7 +24,7 @@ sub sregHook {
...
@@ -24,7 +24,7 @@ sub sregHook {
$h
{
$_
}
=
undef
foreach
(
$h
{
$_
}
=
undef
foreach
(
qw(fullname nickname language postcode timezone country gender email dob)
qw(fullname nickname language postcode timezone country gender email dob)
);
);
$self
->
p
->
updatePersistentSession
(
\
%h
);
$self
->
p
->
updatePersistentSession
(
$req
,
\
%h
);
return
0
;
return
0
;
}
}
...
@@ -166,7 +166,7 @@ sub sregHook {
...
@@ -166,7 +166,7 @@ sub sregHook {
$ag
{
$k
}
=
0
;
$ag
{
$k
}
=
0
;
}
}
}
}
$self
->
p
->
updatePersistentSession
(
\
%toStore
)
if
(
%toStore
);
$self
->
p
->
updatePersistentSession
(
$req
,
\
%toStore
)
if
(
%toStore
);
# Check if user has agreed request
# Check if user has agreed request
if
(
$accepted
)
{
if
(
$accepted
)
{
...
...
lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code.t
View file @
a09af344
...
@@ -185,7 +185,33 @@ ok(
...
@@ -185,7 +185,33 @@ ok(
'
Test if user is reject on SP
'
'
Test if user is reject on SP
'
);
);
count
(
1
);
count
(
1
);
expectRedirection
(
$res
,
qr#^http://auth.op.com/oauth2/authorize#
);
(
$url
,
$query
)
=
expectRedirection
(
$res
,
qr#^http://auth.op.com(/oauth2/authorize)\?(.*)$#
);
# Test if consent was saved
# -------------------------
# Push request to OP
switch
('
op
');
ok
(
$res
=
$op
->
_get
(
$url
,
query
=>
$query
,
accept
=>
'
text/html
'
),
"
Push request to OP, endpoint
$url
"
);
count
(
1
);
expectOK
(
$res
);
# Try to authenticate to OP
$query
=
"
user=french&password=french&
$query
";
ok
(
$res
=
$op
->
_post
(
$url
,
IO::
String
->
new
(
$query
),
accept
=>
'
text/html
',
length
=>
length
(
$query
),
),
"
Post authentication, endpoint
$url
"
);
count
(
1
);
$idpId
=
expectCookie
(
$res
);
expectRedirection
(
$res
,
qr#^http://auth.rp.com/#
);
#print STDERR Dumper($res);
#print STDERR Dumper($res);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment