Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
f3164b78
Commit
f3164b78
authored
6 years ago
by
Tim van Dijen
Browse files
Options
Downloads
Patches
Plain Diff
Fixes for modules/smartattributes
parent
f070961b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/smartattributes/lib/Auth/Process/SmartID.php
+20
-2
20 additions, 2 deletions
modules/smartattributes/lib/Auth/Process/SmartID.php
modules/smartattributes/lib/Auth/Process/SmartName.php
+12
-2
12 additions, 2 deletions
modules/smartattributes/lib/Auth/Process/SmartName.php
with
32 additions
and
4 deletions
modules/smartattributes/lib/Auth/Process/SmartID.php
+
20
−
2
View file @
f3164b78
...
@@ -10,6 +10,8 @@ class SmartID extends \SimpleSAML\Auth\ProcessingFilter
...
@@ -10,6 +10,8 @@ class SmartID extends \SimpleSAML\Auth\ProcessingFilter
* IMPORTANT: If you use the (default) attributemaps (twitter2name, facebook2name,
* IMPORTANT: If you use the (default) attributemaps (twitter2name, facebook2name,
* etc., be sure to comment out the entries that map xxx_targetedID to
* etc., be sure to comment out the entries that map xxx_targetedID to
* eduPersonTargetedID, or there will be no way to see its origin any more.
* eduPersonTargetedID, or there will be no way to see its origin any more.
*
* @var array
*/
*/
private
$candidates
=
[
private
$candidates
=
[
'eduPersonTargetedID'
,
'eduPersonTargetedID'
,
...
@@ -24,29 +26,36 @@ class SmartID extends \SimpleSAML\Auth\ProcessingFilter
...
@@ -24,29 +26,36 @@ class SmartID extends \SimpleSAML\Auth\ProcessingFilter
];
];
/**
/**
* The name of the generated ID attribute.
*
@var string
The name of the generated ID attribute.
*/
*/
private
$id_attribute
=
'smart_id'
;
private
$id_attribute
=
'smart_id'
;
/**
/**
* Whether to append the AuthenticatingAuthority, separated by '!'
* Whether to append the AuthenticatingAuthority, separated by '!'
* This only works when SSP is used as a gateway.
* This only works when SSP is used as a gateway.
* @var bool
*/
*/
private
$add_authority
=
true
;
private
$add_authority
=
true
;
/**
/**
* Whether to prepend the CandidateID, separated by ':'
* Whether to prepend the CandidateID, separated by ':'
* @var bool
*/
*/
private
$add_candidate
=
true
;
private
$add_candidate
=
true
;
/**
/**
* Attributes which should be added/appended.
* Attributes which should be added/appended.
*
*
* Associative array of arrays.
*
@var array
Associative array of arrays.
*/
*/
private
$attributes
=
[];
private
$attributes
=
[];
/**
* @param array $config
* @param mixed $reserved
* @throws \Exception
*/
public
function
__construct
(
$config
,
$reserved
)
public
function
__construct
(
$config
,
$reserved
)
{
{
parent
::
__construct
(
$config
,
$reserved
);
parent
::
__construct
(
$config
,
$reserved
);
...
@@ -82,6 +91,13 @@ class SmartID extends \SimpleSAML\Auth\ProcessingFilter
...
@@ -82,6 +91,13 @@ class SmartID extends \SimpleSAML\Auth\ProcessingFilter
}
}
}
}
/**
* @param array $attributes
* @param array $request
* @return string
* @throws \SimpleSAML\Error\Exception
*/
private
function
addID
(
$attributes
,
$request
)
private
function
addID
(
$attributes
,
$request
)
{
{
$state
=
$request
[
'saml:sp:State'
];
$state
=
$request
[
'saml:sp:State'
];
...
@@ -104,12 +120,14 @@ class SmartID extends \SimpleSAML\Auth\ProcessingFilter
...
@@ -104,12 +120,14 @@ class SmartID extends \SimpleSAML\Auth\ProcessingFilter
them, or try using another identity provider.'
);
them, or try using another identity provider.'
);
}
}
/**
/**
* Apply filter to add or replace attributes.
* Apply filter to add or replace attributes.
*
*
* Add or replace existing attributes with the configured values.
* Add or replace existing attributes with the configured values.
*
*
* @param array &$request The current request
* @param array &$request The current request
* @return void
*/
*/
public
function
process
(
&
$request
)
public
function
process
(
&
$request
)
{
{
...
...
This diff is collapsed.
Click to expand it.
modules/smartattributes/lib/Auth/Process/SmartName.php
+
12
−
2
View file @
f3164b78
...
@@ -8,17 +8,20 @@ namespace SimpleSAML\Module\smartattributes\Auth\Process;
...
@@ -8,17 +8,20 @@ namespace SimpleSAML\Module\smartattributes\Auth\Process;
* @author Andreas Åkre Solberg, UNINETT AS.
* @author Andreas Åkre Solberg, UNINETT AS.
* @package SimpleSAMLphp
* @package SimpleSAMLphp
*/
*/
class
SmartName
extends
\SimpleSAML\Auth\ProcessingFilter
class
SmartName
extends
\SimpleSAML\Auth\ProcessingFilter
{
{
/**
/**
* Attributes which should be added/appended.
* Attributes which should be added/appended.
*
*
* Ass
i
ciative array of arrays.
*
@var array
Ass
o
ciative array of arrays.
*/
*/
private
$attributes
=
[];
private
$attributes
=
[];
/**
* @param array $attributes
* @return string|null
*/
private
function
getFullName
(
$attributes
)
private
function
getFullName
(
$attributes
)
{
{
if
(
isset
(
$attributes
[
'displayName'
]))
{
if
(
isset
(
$attributes
[
'displayName'
]))
{
...
@@ -57,6 +60,11 @@ class SmartName extends \SimpleSAML\Auth\ProcessingFilter
...
@@ -57,6 +60,11 @@ class SmartName extends \SimpleSAML\Auth\ProcessingFilter
return
null
;
return
null
;
}
}
/**
* @param string $userid
* @return string|null
*/
private
function
getLocalUser
(
$userid
)
private
function
getLocalUser
(
$userid
)
{
{
if
(
strpos
(
$userid
,
'@'
)
===
false
)
{
if
(
strpos
(
$userid
,
'@'
)
===
false
)
{
...
@@ -69,12 +77,14 @@ class SmartName extends \SimpleSAML\Auth\ProcessingFilter
...
@@ -69,12 +77,14 @@ class SmartName extends \SimpleSAML\Auth\ProcessingFilter
return
null
;
return
null
;
}
}
/**
/**
* Apply filter to add or replace attributes.
* Apply filter to add or replace attributes.
*
*
* Add or replace existing attributes with the configured values.
* Add or replace existing attributes with the configured values.
*
*
* @param array &$request The current request
* @param array &$request The current request
* @return void
*/
*/
public
function
process
(
&
$request
)
public
function
process
(
&
$request
)
{
{
...
...
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