Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp-module-authswitcher
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
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
Perun
Perun ProxyIdP
v1
simplesamlphp-module-authswitcher
Commits
39090b9a
Unverified
Commit
39090b9a
authored
2 years ago
by
Pavel Břoušek
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #44 from CESNET/melanger-patch-1
fix: prevent empty mfaTokens
parents
c236355b
7a85d9bf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/Auth/Process/GetMfaTokensPrivacyIDEA.php
+5
-2
5 additions, 2 deletions
lib/Auth/Process/GetMfaTokensPrivacyIDEA.php
with
5 additions
and
2 deletions
lib/Auth/Process/GetMfaTokensPrivacyIDEA.php
+
5
−
2
View file @
39090b9a
...
@@ -68,7 +68,6 @@ class GetMfaTokensPrivacyIDEA extends \SimpleSAML\Auth\ProcessingFilter
...
@@ -68,7 +68,6 @@ class GetMfaTokensPrivacyIDEA extends \SimpleSAML\Auth\ProcessingFilter
public
function
process
(
&
$state
)
public
function
process
(
&
$state
)
{
{
$state
[
Authswitcher
::
PRIVACY_IDEA_FAIL
]
=
false
;
$state
[
Authswitcher
::
PRIVACY_IDEA_FAIL
]
=
false
;
$state
[
'Attributes'
][
$this
->
tokens_attr
]
=
[];
$admin_token
=
$this
->
getAdminToken
();
$admin_token
=
$this
->
getAdminToken
();
if
(
empty
(
$admin_token
))
{
if
(
empty
(
$admin_token
))
{
$state
[
AuthSwitcher
::
PRIVACY_IDEA_FAIL
]
=
true
;
$state
[
AuthSwitcher
::
PRIVACY_IDEA_FAIL
]
=
true
;
...
@@ -165,14 +164,18 @@ class GetMfaTokensPrivacyIDEA extends \SimpleSAML\Auth\ProcessingFilter
...
@@ -165,14 +164,18 @@ class GetMfaTokensPrivacyIDEA extends \SimpleSAML\Auth\ProcessingFilter
private
function
saveTokensToStateAttributes
(
&
$state
,
$tokens
)
private
function
saveTokensToStateAttributes
(
&
$state
,
$tokens
)
{
{
$types
=
[];
foreach
(
$tokens
as
$token
)
{
foreach
(
$tokens
as
$token
)
{
foreach
(
$this
->
tokens_type
as
$type
)
{
foreach
(
$this
->
tokens_type
as
$type
)
{
if
(
$token
[
'tokentype'
]
===
strtolower
(
$type
))
{
if
(
$token
[
'tokentype'
]
===
strtolower
(
$type
))
{
$token
[
$this
->
token_type_attr
]
=
$type
;
$token
[
$this
->
token_type_attr
]
=
$type
;
$
state
[
'Attributes'
][
$this
->
tokens_attr
]
[]
=
$token
;
$
types
[]
=
$token
;
break
;
break
;
}
}
}
}
}
}
if
(
!
empty
(
$types
))
{
$state
[
'Attributes'
][
$this
->
tokens_attr
]
=
$types
;
}
}
}
}
}
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