Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Christophe Turbout
auth
Commits
c27761cb
Commit
c27761cb
authored
Apr 10, 2019
by
Bertrand Gauthier
Browse files
ShibService : correction nécessaire pour tester si un utilisateur est authentifié ou non.
parent
7f8d9248
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/UnicaenAuth/Service/ShibService.php
View file @
c27761cb
...
...
@@ -85,12 +85,24 @@ EOS;
// ENSUITE activation éventuelle de l'usurpation
$this
->
handleUsurpation
();
if
(
!
$this
->
isAuthenticated
())
{
return
null
;
}
$this
->
authenticatedUser
=
$this
->
createShibUserFromServerArrayData
();
}
return
$this
->
authenticatedUser
;
}
/**
* @return bool
*/
private
function
isAuthenticated
()
{
return
(
bool
)
$this
->
getServerArrayVariable
(
'REMOTE_USER'
);
}
/**
* @return boolean
*/
...
...
@@ -351,6 +363,9 @@ EOS;
*/
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
// foreach ($this->getShibbolethRequiredAttributes() as $requiredAttribute) {
// // un pipe permet d'exprimer un OU logique, ex: 'supannEmpId|supannEtuId'
...
...
@@ -452,8 +467,8 @@ EOS;
'options'
=>
[
'route'
=>
'/connexion'
,
'defaults'
=>
[
'controller'
=>
'zfcuser'
,
// NB: lorsque l'auth Shibboleth est activée, la page propose
'action'
=>
'login'
,
// 2 possibilités d'auth : LDAP et Shibboleth.
'controller'
=>
'zfcuser'
,
'action'
=>
'login'
,
],
],
],
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment