Skip to content

Commit ddd54a1

Browse files
committed
Remove base64attributes feature
This would encode all attributes sent by the IdP (or decode received by the SP) with base64. As far as I could deduce this is from the early days of federation, used nowhere anymore, no one came forward that did, but cannot get certainty. Best way to find out might just be to drop it. We can easily reinstate it if some use case does turn up. Note that the IdP can still perform this behaviour with the more generic attributeencodings feature.
1 parent 9bb44f1 commit ddd54a1

4 files changed

Lines changed: 3 additions & 35 deletions

File tree

docs/simplesamlphp-reference-idp-hosted.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,7 @@ The following SAML 2.0 options are available:
147147
: - `string`: Will include the attribute as a normal string. This is
148148
the default.
149149

150-
: - `base64`: Store the attribute as a base64 encoded string. This
151-
is the default when the `base64attributes`-option is set to
152-
`TRUE`.
150+
: - `base64`: Store the attribute as a base64 encoded string.
153151

154152
: - `raw`: Store the attribute without any modifications. This
155153
makes it possible to include raw XML in the response.

docs/simplesamlphp-reference-sp-remote.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ The following options can be set:
3131
: Used to manipulate attributes, and limit access for each SP. See
3232
the [authentication processing filter manual](simplesamlphp-authproc).
3333

34-
`base64attributes`
35-
: Whether attributes sent to this SP should be base64 encoded. The
36-
default is `FALSE`.
37-
3834
`description`
3935
: A description of this SP. Will be used by various modules when they
4036
need to show a description of the SP to the user.
@@ -104,9 +100,7 @@ The following options can be set:
104100
: - `string`: Will include the attribute as a normal string. This is
105101
the default.
106102

107-
: - `base64`: Store the attribute as a base64 encoded string. This
108-
is the default when the `base64attributes`-option is set to
109-
`TRUE`.
103+
: - `base64`: Store the attribute as a base64 encoded string.
110104

111105
: - `raw`: Store the attribute without any modifications. This
112106
makes it possible to include raw XML in the response.

modules/saml/src/IdP/SAML2.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -974,16 +974,7 @@ private static function encodeAttributes(
974974
Configuration $spMetadata,
975975
array $attributes
976976
): array {
977-
$base64Attributes = $spMetadata->getOptionalBoolean('base64attributes', null);
978-
if ($base64Attributes === null) {
979-
$base64Attributes = $idpMetadata->getOptionalBoolean('base64attributes', false);
980-
}
981-
982-
if ($base64Attributes) {
983-
$defaultEncoding = 'base64';
984-
} else {
985-
$defaultEncoding = 'string';
986-
}
977+
$defaultEncoding = 'string';
987978

988979
$srcEncodings = $idpMetadata->getOptionalArray('attributeencodings', []);
989980
$dstEncodings = $spMetadata->getOptionalArray('attributeencodings', []);

modules/saml/src/Message.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -829,21 +829,6 @@ private static function processAssertion(
829829
}
830830
// as far as we can tell, the assertion is valid
831831

832-
// maybe we need to base64 decode the attributes in the assertion?
833-
if ($idpMetadata->getOptionalBoolean('base64attributes', false)) {
834-
$attributes = $assertion->getAttributes();
835-
$newAttributes = [];
836-
foreach ($attributes as $name => $values) {
837-
$newAttributes[$name] = [];
838-
foreach ($values as $value) {
839-
foreach (explode('_', $value) as $v) {
840-
$newAttributes[$name][] = base64_decode($v);
841-
}
842-
}
843-
}
844-
$assertion->setAttributes($newAttributes);
845-
}
846-
847832
// decrypt the NameID element if it is encrypted
848833
if ($assertion->isNameIdEncrypted()) {
849834
try {

0 commit comments

Comments
 (0)