Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
lemonldap-ng
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maxime Besson
lemonldap-ng
Commits
de969f19
Commit
de969f19
authored
Dec 22, 2016
by
Yadd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CAS in progress (#595)
parent
747cd860
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
9 deletions
+15
-9
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/CAS.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/CAS.pm
+10
-6
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/CAS.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/CAS.pm
+2
-2
lemonldap-ng-portal/t/31-Auth-and-issuer-CAS.t
lemonldap-ng-portal/t/31-Auth-and-issuer-CAS.t
+3
-1
No files found.
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/CAS.pm
View file @
de969f19
...
...
@@ -432,7 +432,7 @@ sub _validate2 {
my
$service
=
$req
->
param
('
service
');
my
$ticket
=
$req
->
param
('
ticket
');
my
$pgtUrl
=
$req
->
param
('
pgtUrl
');
my
$renew
=
$req
->
param
('
renew
');
my
$renew
=
$req
->
param
('
renew
')
//
'
false
'
;
# PGTIOU
my
$casProxyGrantingTicketIOU
;
...
...
@@ -621,16 +621,20 @@ sub _validate2 {
# Get username
my
$username
=
$localSession
->
data
->
{
$self
->
{
casAttr
}
||
$self
->
{
whatToTrace
}
};
$localSession
->
data
->
{
$self
->
conf
->
{
casAttr
}
||
$self
->
conf
->
{
whatToTrace
}
};
$self
->
lmLog
(
"
Get username
$username
",
'
debug
'
);
# Get attributes [CAS 3.0]
my
$attributes
=
{};
if
(
defined
$self
->
{
casAttributes
}
)
{
foreach
my
$casAttribute
(
keys
%
{
$self
->
{
casAttributes
}
}
)
{
if
(
defined
$self
->
conf
->
{
casAttributes
}
and
%
{
$self
->
conf
->
{
casAttributes
}
}
)
{
foreach
my
$casAttribute
(
keys
%
{
$self
->
conf
->
{
casAttributes
}
}
)
{
my
$localSessionValue
=
$localSession
->
data
->
{
$self
->
{
casAttributes
}
->
{
$casAttribute
}
};
$localSession
->
data
->
{
$self
->
conf
->
{
casAttributes
}
->
{
$casAttribute
}
};
$attributes
->
{
$casAttribute
}
=
$localSessionValue
if
defined
$localSessionValue
;
}
...
...
@@ -638,7 +642,7 @@ sub _validate2 {
# Return success message
$self
->
deleteCasSession
(
$casServiceSession
);
return
$self
->
returnCasServiceValidateSuccess
(
$username
,
return
$self
->
returnCasServiceValidateSuccess
(
$
req
,
$
username
,
$casProxyGrantingTicketIOU
,
$proxies
,
$attributes
);
}
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/CAS.pm
View file @
de969f19
...
...
@@ -102,7 +102,7 @@ sub returnCasServiceValidateSuccess {
$self
->
lmLog
(
"
Return CAS service validate success with username
$username
",
'
debug
'
);
my
$s
=
"
<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas
my
$s
=
"
<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas
'>
\t
<cas:authenticationSuccess>
\t\t
<cas:user>
$username
</cas:user>
\n
";
if
(
defined
$attributes
)
{
...
...
@@ -110,7 +110,7 @@ sub returnCasServiceValidateSuccess {
foreach
my
$attribute
(
keys
%$attributes
)
{
foreach
my
$value
(
split
(
$self
->
{
multiValuesSeparator
},
$self
->
conf
->
{
multiValuesSeparator
},
$attributes
->
{
$attribute
}
)
)
...
...
lemonldap-ng-portal/t/31-Auth-and-issuer-CAS.t
View file @
de969f19
...
...
@@ -106,7 +106,7 @@ done_testing( count() );
# Redefine LWP methods for tests
sub
mygethttps2
{
my
(
$host
,
$port
,
$path
,
$ssl_data
)
=
@_
;
ok
(
$path
=~
m#^(/[^\?]+)(?:\?(.*))?$#
,
"
Path to push to IdP:
$path
");
ok
(
$path
=~
m#^(/[^\?]+)(?:\?(.*))?$#
,
"
Path to push to IdP:
$path
"
);
$path
=
$
1
;
my
$query
=
$
2
;
ok
(
$res
=
$issuer
->
_get
(
$path
,
query
=>
$query
),
'
Execute request
'
);
...
...
@@ -138,6 +138,7 @@ sub issuer {
casAttr
=>
'
uid
',
casAttributes
=>
{
cn
=>
'
cn
',
uid
=>
'
uid
',
},
casAccessControlPolicy
=>
'
none
',
multiValuesSeparator
=>
'
;
',
}
}
);
...
...
@@ -155,6 +156,7 @@ sub sp {
issuerDBCASActivation
=>
0
,
CASurl
=>
'
http://auth.idp.com/cas
',
CASCAFile
=>
'
t/caFile.pem
',
multiValuesSeparator
=>
'
;
',
},
}
);
...
...
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