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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
Xavier Bachelot
lemonldap-ng
Commits
9ab04631
Commit
9ab04631
authored
Apr 05, 2017
by
Yadd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Auth::Kerberos skeleton (#707)
parent
289930e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
0 deletions
+89
-0
lemonldap-ng-portal/MANIFEST
lemonldap-ng-portal/MANIFEST
+1
-0
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Kerberos.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Kerberos.pm
+88
-0
No files found.
lemonldap-ng-portal/MANIFEST
View file @
9ab04631
...
...
@@ -19,6 +19,7 @@ lib/Lemonldap/NG/Portal/Auth/Custom.pm
lib/Lemonldap/NG/Portal/Auth/DBI.pm
lib/Lemonldap/NG/Portal/Auth/Demo.pm
lib/Lemonldap/NG/Portal/Auth/Facebook.pm
lib/Lemonldap/NG/Portal/Auth/Kerberos.pm
lib/Lemonldap/NG/Portal/Auth/LDAP.pm
lib/Lemonldap/NG/Portal/Auth/Null.pm
lib/Lemonldap/NG/Portal/Auth/OpenID.pm
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Kerberos.pm
0 → 100644
View file @
9ab04631
package
Lemonldap::NG::Portal::Auth::
Kerberos
;
use
strict
;
use
Mouse
;
use
GSSAPI
;
use
MIME::
Base64
;
use
Lemonldap::NG::Portal::Main::
Constants
qw(
PE_ERROR
PE_OK
PE_SENDRESPONSE
)
;
our
$VERSION
=
'
2.0.0
';
extends
'
Lemonldap::NG::Portal::Auth::Base
';
# INITIALIZATION
sub
init
{
my
(
$self
)
=
@_
;
}
sub
extractFormInfo
{
my
(
$self
,
$req
)
=
@_
;
my
$auth
=
$req
->
env
->
{
HTTP_AUTHORIZATION
};
unless
(
$auth
)
{
$req
->
response
(
[
410
,
[
'
WWW-Authenticate
'
=>
'
Negotiate
'
],
['
Authentication required
']
]
);
return
PE_SENDRESPONSE
;
}
if
(
$auth
!~
/^Negotiate (.*)$/
)
{
$self
->
userLogger
->
error
('
Bad authorization header
');
$req
->
response
(
[
403
,
[]
,
['
Forbidden
']
]
);
return
PE_SENDRESPONSE
;
}
my
$data
;
eval
{
$data
=
MIME::Base64::
decode
(
$
1
)
};
if
(
$@
)
{
$self
->
userLogger
->
error
(
'
Bad authorization header:
'
.
$@
);
return
PE_ERROR
;
}
my
$server_context
;
my
$status
=
GSSAPI::Context::
accept
(
$server_context
,
GSS_C_NO_CREDENTIAL
,
$data
,
GSS_C_NO_CHANNEL_BINDINGS
,
my
$gss_client_name
,
my
$out_mech
,
my
$gss_output_token
,
my
$out_flags
,
my
$out_time
,
my
$gss_delegated_cred
);
unless
(
$status
)
{
$self
->
logger
->
error
('
Unable to accept security context
');
return
PE_ERROR
;
}
my
$client_name
;
$status
=
$gss_client_name
->
display
(
$client_name
);
unless
(
$status
)
{
$self
->
logger
->
error
('
Unable to display KRB client name
');
return
PE_ERROR
;
}
$req
->
user
(
$client_name
);
return
PE_OK
;
}
sub
authenticate
{
PE_OK
;
}
sub
setAuthSessionInfo
{
my
(
$self
,
$req
)
=
@_
;
$req
->
{
sessionInfo
}
->
{
authenticationLevel
}
=
$self
->
conf
->
{
SSLAuthnLevel
};
PE_OK
;
}
sub
getDisplayType
{
return
"
logo
";
}
1
;
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