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
31496271
Commit
31496271
authored
Dec 20, 2016
by
Yadd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CAS in progress (#595)
parent
c0d87561
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
118 additions
and
3 deletions
+118
-3
lemonldap-ng-portal/MANIFEST
lemonldap-ng-portal/MANIFEST
+1
-0
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/CAS.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/CAS.pm
+4
-2
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDB/SAML.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDB/SAML.pm
+1
-1
lemonldap-ng-portal/t/31-Auth-and-issuer-CAS.t
lemonldap-ng-portal/t/31-Auth-and-issuer-CAS.t
+106
-0
lemonldap-ng-portal/t/lmConf-1.js
lemonldap-ng-portal/t/lmConf-1.js
+6
-0
No files found.
lemonldap-ng-portal/MANIFEST
View file @
31496271
...
...
@@ -361,6 +361,7 @@ t/30-Auth-and-issuer-SAML-POST-IdP-initiated.t
t/30-Auth-and-issuer-SAML-POST.t
t/30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t
t/30-Auth-and-issuer-SAML-Redirect.t
t/31-Auth-and-issuer-CAS.t
t/40-Notifications-DBI.t
t/50-IssuerGet.t
t/90-translations.t
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/CAS.pm
View file @
31496271
package
Lemonldap::NG::Portal::Auth::
SAML
;
package
Lemonldap::NG::Portal::Auth::
CAS
;
use
strict
;
use
Mouse
;
...
...
@@ -12,7 +12,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
our
$VERSION
=
'
2.0.0
';
extends
'
Lemonldap::NG::Portal::Auth::Base
',
'
Lemonldap::NG::Portal::Lib::
SAML
';
extends
'
Lemonldap::NG::Portal::Auth::Base
',
'
Lemonldap::NG::Portal::Lib::
CAS
';
# PROPERTIES
...
...
@@ -211,6 +211,8 @@ sub authLogout {
sub
getDisplayType
{
return
"
logo
";
}
1
;
__END__
=head1 NAME
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDB/SAML.pm
View file @
31496271
...
...
@@ -33,7 +33,7 @@ sub init {
return
1
;
}
# RUNN
O
NG METHODS
# RUNN
I
NG METHODS
# Does nothing
sub
getUser
{
...
...
lemonldap-ng-portal/t/31-Auth-and-issuer-CAS.t
0 → 100644
View file @
31496271
use
Test::
More
;
use
strict
;
use
IO::
String
;
use
MIME::
Base64
;
BEGIN
{
require
'
t/test-lib.pm
';
}
my
$maintests
=
1
;
my
$debug
=
'
error
';
my
(
$issuer
,
$sp
,
$res
);
my
%handlerOR
=
(
issuer
=>
[]
,
sp
=>
[]
);
SKIP:
{
eval
"
use AuthCAS
";
if
(
$@
)
{
skip
'
AuthCAS not found
',
$maintests
;
}
#ok( $issuer = issuer(), 'Issuer portal' );
#$handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::Reload::_onReload;
switch
('
sp
');
ok
(
$sp
=
sp
(),
'
SP portal
'
);
$handlerOR
{
sp
}
=
\
@
Lemonldap::NG::Handler::Main::Reload::
_onReload
;
}
count
(
$maintests
);
clean_sessions
();
done_testing
(
count
()
);
# Redefine LWP methods for tests
no
warnings
'
redefine
';
sub
LWP
::UserAgent::request {
my
(
$self
,
$req
)
=
@_
;
ok
(
$req
->
uri
=~
m#http://auth.sp.com(.*)#
,
'
Request from SP to IdP
'
);
my
$url
=
$
1
;
my
$res
;
my
$s
=
$req
->
content
;
ok
(
$res
=
$sp
->
_post
(
$url
,
IO::
String
->
new
(
$s
),
length
=>
length
(
$s
),
type
=>
'
application/xml
',
),
'
Execute request
'
);
ok
(
(
$res
->
[
0
]
==
200
or
$res
->
[
0
]
==
400
),
'
Response is 200 or 400
'
)
or
explain
(
$res
->
[
0
],
"
200 or 400
"
);
ok
(
$issuer
->
getHeader
(
$res
,
'
Content-Type
'
)
=~
m#^application/xml#
,
'
Content is XML
'
)
or
explain
(
$res
->
[
1
],
'
Content-Type => application/xml
'
);
my
$httpResp
=
HTTP::
Response
->
new
(
$res
->
[
0
],
'
OK
'
);
while
(
my
$name
=
shift
@
{
$res
->
[
1
]
}
)
{
$httpResp
->
header
(
$name
,
shift
(
@
{
$res
->
[
1
]
}
)
);
}
$httpResp
->
content
(
join
(
'',
@
{
$res
->
[
2
]
}
)
);
count
(
4
);
return
$httpResp
;
}
sub
switch
{
my
$type
=
shift
;
@
Lemonldap::NG::Handler::Main::Reload::
_onReload
=
@
{
$handlerOR
{
$type
};
};
}
sub
issuer
{
return
LLNG::Manager::
Test
->
new
(
{
ini
=>
{
logLevel
=>
$debug
,
templatesDir
=>
'
site/htdocs/static
',
domain
=>
'
idp.com
',
portal
=>
'
http://auth.idp.com
',
authentication
=>
'
Demo
',
userDB
=>
'
Demo
',
issuerDBCASActivation
=>
1
,
casAttr
=>
'
uid
',
casAttributes
=>
{
cn
=>
'
cn
',
uid
=>
'
uid
',
},
casAccessControlPolicy
=>
'
none
',
}
}
);
}
sub
sp
{
return
LLNG::Manager::
Test
->
new
(
{
ini
=>
{
logLevel
=>
$debug
,
domain
=>
'
sp.com
',
portal
=>
'
http://auth.sp.com
',
authentication
=>
'
CAS
',
userDB
=>
'
Null
',
issuerDBCASActivation
=>
0
,
CASurl
=>
'
http://auth.idp.com/cas/
',
CASCAFile
=>
'
t/caFile.pem
',
},
}
);
}
lemonldap-ng-portal/t/lmConf-1.js
View file @
31496271
...
...
@@ -54,6 +54,12 @@
"
notifications
"
:
0
,
"
passwordDB
"
:
"
Null
"
,
"
portal
"
:
"
http://auth.example.com/
"
,
"
casStorage
"
:
"
Apache::Session::File
"
,
"
casStorageOptions
"
:
{
"
Directory
"
:
"
t/sessions/saml
"
,
"
LockDirectory
"
:
"
t/sessions/saml/lock
"
,
"
generateModule
"
:
"
Lemonldap::NG::Common::Apache::Session::Generate::SHA256
"
},
"
samlStorage
"
:
"
Apache::Session::File
"
,
"
samlStorageOptions
"
:
{
"
Directory
"
:
"
t/sessions/saml
"
,
...
...
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