Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auth
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lib
unicaen
auth
Commits
c27761cb
Commit
c27761cb
authored
6 years ago
by
Bertrand Gauthier
Browse files
Options
Downloads
Patches
Plain Diff
ShibService : correction nécessaire pour tester si un utilisateur est authentifié ou non.
parent
7f8d9248
No related branches found
No related tags found
No related merge requests found
Pipeline
#4285
failed
6 years ago
Stage: publish
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/UnicaenAuth/Service/ShibService.php
+17
-2
17 additions, 2 deletions
src/UnicaenAuth/Service/ShibService.php
with
17 additions
and
2 deletions
src/UnicaenAuth/Service/ShibService.php
+
17
−
2
View file @
c27761cb
...
@@ -85,12 +85,24 @@ EOS;
...
@@ -85,12 +85,24 @@ EOS;
// ENSUITE activation éventuelle de l'usurpation
// ENSUITE activation éventuelle de l'usurpation
$this
->
handleUsurpation
();
$this
->
handleUsurpation
();
if
(
!
$this
->
isAuthenticated
())
{
return
null
;
}
$this
->
authenticatedUser
=
$this
->
createShibUserFromServerArrayData
();
$this
->
authenticatedUser
=
$this
->
createShibUserFromServerArrayData
();
}
}
return
$this
->
authenticatedUser
;
return
$this
->
authenticatedUser
;
}
}
/**
* @return bool
*/
private
function
isAuthenticated
()
{
return
(
bool
)
$this
->
getServerArrayVariable
(
'REMOTE_USER'
);
}
/**
/**
* @return boolean
* @return boolean
*/
*/
...
@@ -351,6 +363,9 @@ EOS;
...
@@ -351,6 +363,9 @@ EOS;
*/
*/
public
function
simulateAuthenticatedUser
(
ShibUser
$shibUser
,
$keyForId
=
'supannEmpId'
)
public
function
simulateAuthenticatedUser
(
ShibUser
$shibUser
,
$keyForId
=
'supannEmpId'
)
{
{
// 'REMOTE_USER' est utilisé pour savoir si un utilisateur est authentifié ou non
$this
->
setServerArrayVariable
(
'REMOTE_USER'
,
$shibUser
->
getEppn
());
// // on s'assure que tous les attributs obligatoires ont une valeur
// // on s'assure que tous les attributs obligatoires ont une valeur
// foreach ($this->getShibbolethRequiredAttributes() as $requiredAttribute) {
// foreach ($this->getShibbolethRequiredAttributes() as $requiredAttribute) {
// // un pipe permet d'exprimer un OU logique, ex: 'supannEmpId|supannEtuId'
// // un pipe permet d'exprimer un OU logique, ex: 'supannEmpId|supannEtuId'
...
@@ -452,8 +467,8 @@ EOS;
...
@@ -452,8 +467,8 @@ EOS;
'options'
=>
[
'options'
=>
[
'route'
=>
'/connexion'
,
'route'
=>
'/connexion'
,
'defaults'
=>
[
'defaults'
=>
[
'controller'
=>
'zfcuser'
,
// NB: lorsque l'auth Shibboleth est activée, la page propose
'controller'
=>
'zfcuser'
,
'action'
=>
'login'
,
// 2 possibilités d'auth : LDAP et Shibboleth.
'action'
=>
'login'
,
],
],
],
],
],
],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment