Skip to content

Commit 6fd598a

Browse files
committed
Clear out the confusion about the use of ACS acronym
ACS is usually used to refer to the Assertion Consumer Service concept in SAML. The ACS may also behave as an Attribute Consuming Services, but in general the two concepts are separate. This fixes the use of the ACS acronym for the Assertion Consumer Service only.
1 parent 06c23a5 commit 6fd598a

File tree

7 files changed

+41
-38
lines changed

7 files changed

+41
-38
lines changed

README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -479,28 +479,28 @@ The getSPMetadata will return the metadata signed or not based on the security p
479479

480480
Before the XML metadata is exposed, a check takes place to ensure that the info to be provided is valid.
481481

482-
##### Attribute Consuming Service (ACS)
482+
##### Attribute Consuming Services
483483
The SP may optionally specify one or more Attribute Consuming Services in its metadata. These can be configured in the settings.
484484

485-
If just one ACS is required:
485+
If just one Attribute Consuming Service is required:
486486

487487
```properties
488-
# Attribute Consuming Service name when just one ACS should be declared by the SP.
489-
# Comment out or set to empty if no ACS should be declared, or if multiple ones should (see below).
488+
# Attribute Consuming Service name when just one such service should be declared by the SP.
489+
# Comment out or set to empty if no Attribute Consuming Service should be declared, or if multiple ones should (see below).
490490
# The service name is mandatory.
491491
onelogin.saml2.sp.attribute_consuming_service.name = My service
492492

493-
# Attribute Consuming Service description when just one ACS should be declared by the SP.
493+
# Attribute Consuming Service description when just one such service should be declared by the SP.
494494
# Ignored if the previous property is commented or empty.
495495
# The service description is optional.
496496
onelogin.saml2.sp.attribute_consuming_service.description = My service description
497497

498-
# Language used for Attribute Consuming Service name and description when just one ACS should be declared by the SP.
498+
# Language used for Attribute Consuming Service name and description when just one such service should be declared by the SP.
499499
# Ignored if the name property is commented or empty.
500500
# The language is optional and default to "en" (English).
501501
onelogin.saml2.sp.attribute_consuming_service.lang = en
502502

503-
# Requested attributes to be included in the Attribute Consuming Service when just one ACS should be declared by the SP.
503+
# Requested attributes to be included in the Attribute Consuming Service when just one such service should be declared by the SP.
504504
# At least one requested attribute must be specified, otherwise schema validation will fail.
505505
# Attribute properties are indexed properties, starting from 0. The index is used only to enumerate and sort attributes, but it's required.
506506
# The following properties allow to define each requested attribute:
@@ -520,9 +520,10 @@ onelogin.saml2.sp.attribute_consuming_service.attribute[0].value[0] = foo@exampl
520520
onelogin.saml2.sp.attribute_consuming_service.attribute[0].value[1] = bar@example.org
521521
```
522522

523-
If multiple ACSs are required, they can be specified in a similar way, but using indexes: these indexes are used to enumerate and
524-
identify attribute consuming services within the SP metadata and can be subsequently used in the auth process to specify which
525-
attribute set should be requested to the IdP. The "default" property can also be set to designate the default ACS. Here is an example:
523+
If multiple Attribute Consuming Services are required, they can be specified in a similar way, but using indexes: these indexes
524+
are used to enumerate and identify attribute consuming services within the SP metadata and can be subsequently used in the auth
525+
process to specify which attribute set should be requested to the IdP. The "default" property can also be set to designate the
526+
default Attribute Consuming Service. Here is an example:
526527

527528
```properties
528529
onelogin.saml2.sp.attribute_consuming_service[0].name = Just e-mail
@@ -550,15 +551,17 @@ import static com.onelogin.saml2.authn.AttributeConsumingServiceSelector.*;
550551
Auth auth = new Auth(request, response);
551552
// select by index 1
552553
auth.login(new AuthnRequestParams(false, false, true, byIndex(1));
553-
// or select by ACS name
554+
// or select by service name
554555
auth.login(new AuthnRequestParams(false, false, true, byServiceName(auth.getSettings(), "Anagrafica"));
555556
// or see AttributeConsumingServiceSelector interface implementations for more options
556557
```
557558

558559
If no selector is specified, `AttributeConsumingServiceSelector.useDefault()` will be used, which will simply omit any
559560
`AttributeConsumingServiceIndex` from the request, hence leaving the IdP choose the default attribute set agreed upon.
560561

561-
Then, the following code handles the SAML response that the IdP forwards to the SP through the user's client:
562+
563+
##### Assertion Consumer Service (ACS)
564+
This code handles the SAML response that the IdP forwards to the SP through the user's client:
562565
563566
```java
564567
Auth auth = new Auth(request, response);

core/src/main/java/com/onelogin/saml2/settings/Metadata.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private StrSubstitutor generateSubstitutor(Saml2Settings settings) throws Certif
157157
valueMap.put("spAssertionConsumerServiceUrl", settings.getSpAssertionConsumerServiceUrl().toString());
158158
valueMap.put("sls", toSLSXml(settings.getSpSingleLogoutServiceUrl(), settings.getSpSingleLogoutServiceBinding()));
159159

160-
// if an ACS was specified at construction time, use it in place of the ones specified in settings
160+
// if an Attribute Consuming Service was specified at construction time, use it in place of the ones specified in settings
161161
// this is for backward compatibility
162162
valueMap.put("strAttributeConsumingService",
163163
toAttributeConsumingServicesXml(attributeConsumingService != null

core/src/main/java/com/onelogin/saml2/settings/SettingsBuilder.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -499,17 +499,17 @@ private List<Contact> loadContacts() {
499499
*/
500500
private List<AttributeConsumingService> loadAttributeConsumingServices() {
501501
// first split properties into a map of properties
502-
// key = ACS index; value = ACS properties
502+
// key = service index; value = service properties
503503
final SortedMap<Integer, Map<String, Object>> acsProps =
504504
extractIndexedProperties(SP_ATTRIBUTE_CONSUMING_SERVICE_PROPERTY_KEY_PREFIX, samlData);
505-
// then build each ACS
505+
// then build each Attribute Consuming Service
506506
if(acsProps.containsKey(-1) && acsProps.size() == 1)
507-
// single ACS specified; use index 1 for backward compatibility
507+
// single service specified; use index 1 for backward compatibility
508508
return Arrays.asList(loadAttributeConsumingService(acsProps.get(-1), 1));
509509
else
510-
// multiple indexed ACSs specified
510+
// multiple indexed services specified
511511
return acsProps.entrySet().stream()
512-
// ignore non-indexed ACS
512+
// ignore non-indexed service
513513
.filter(entry -> entry.getKey() != -1)
514514
.map(entry -> loadAttributeConsumingService(entry.getValue(), entry.getKey()))
515515
.collect(Collectors.toList());
@@ -519,10 +519,10 @@ private List<AttributeConsumingService> loadAttributeConsumingServices() {
519519
* Loads a single Attribute Consuming Service from settings.
520520
*
521521
* @param acsProps
522-
* a map containing the ACS settings
522+
* a map containing the Attribute Consuming Service settings
523523
* @param index
524-
* the index to be set on the returned ACS
525-
* @return the loaded ACS
524+
* the index to be set on the returned Attribute Consuming Service
525+
* @return the loaded Attribute Consuming Service
526526
*/
527527
private AttributeConsumingService loadAttributeConsumingService(Map<String, Object> acsProps, int index) {
528528
final String serviceName = loadStringProperty(SP_ATTRIBUTE_CONSUMING_SERVICE_NAME_PROPERTY_KEY_SUFFIX, acsProps);

core/src/test/java/com/onelogin/saml2/test/settings/MetadataTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ public void testToAttributeConsumingServiceXmlWithMultipleAttributeValueLegacy()
436436
* @see com.onelogin.saml2.settings.Metadata#toAttributeConsumingServicesXml
437437
*/
438438
@Test
439-
public void testToAttributeConsumingServiceXmlSingleACS() throws IOException, CertificateEncodingException, Error {
439+
public void testToAttributeConsumingServiceXmlSingleService() throws IOException, CertificateEncodingException, Error {
440440
Saml2Settings settings = getSettingFromAllProperties();
441441

442442
Metadata metadataObj = new Metadata(settings, null, null);
@@ -471,8 +471,8 @@ public void testToAttributeConsumingServiceXmlSingleACS() throws IOException, Ce
471471
* @see com.onelogin.saml2.settings.Metadata#toAttributeConsumingServicesXml
472472
*/
473473
@Test
474-
public void testToAttributeConsumingServiceXmlMultiACS() throws IOException, CertificateEncodingException, Error {
475-
Saml2Settings settings = getSettingFromAllPropertiesMultiACS();
474+
public void testToAttributeConsumingServiceXmlMultiServices() throws IOException, CertificateEncodingException, Error {
475+
Saml2Settings settings = getSettingFromAllPropertiesMultiAttributeConsumingServices();
476476

477477
Metadata metadataObj = new Metadata(settings, null, null);
478478
String metadataStr = metadataObj.getMetadataString();
@@ -505,7 +505,7 @@ public void testToAttributeConsumingServiceXmlMultiACS() throws IOException, Cer
505505
assertThat(metadataStr, containsString(reqAttr22Str));
506506
assertThat(metadataStr, containsString(footer2Str));
507507

508-
// properties for a single ACS must NOT be present in this case
508+
// properties for a single Attribute Consuming Service must NOT be present in this case
509509
String sNameStr = "<md:ServiceName xml:lang=\"en\">My service</md:ServiceName>";
510510
String sDescStr = "<md:ServiceDescription xml:lang=\"en\">My service description</md:ServiceDescription>";
511511
String reqAttr1Str = "<md:RequestedAttribute Name=\"Email_Wrong\" NameFormat=\"urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress\" FriendlyName=\"E-mail address\" isRequired=\"true\">";
@@ -602,7 +602,7 @@ private Saml2Settings getSettingFromAllProperties() throws Error, IOException {
602602
return new SettingsBuilder().fromFile("config/config.all.properties").build();
603603
}
604604

605-
private Saml2Settings getSettingFromAllPropertiesMultiACS() throws Error, IOException {
605+
private Saml2Settings getSettingFromAllPropertiesMultiAttributeConsumingServices() throws Error, IOException {
606606
return new SettingsBuilder().fromFile("config/config.all_multi_attribute_consuming_services.properties").build();
607607
}
608608

core/src/test/resources/config/config.all.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@ onelogin.saml2.sp.single_logout_service.binding = urn:oasis:names:tc:SAML:2.0:bi
3131
# Take a look on lib/Saml2/Constants.php to see the NameIdFormat supported
3232
onelogin.saml2.sp.nameidformat = urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
3333

34-
# Attribute Consuming Service name when just one ACS should be declared by the SP.
35-
# Comment out or set to empty if no ACS should be declared, or if multiple ones should (see below).
34+
# Attribute Consuming Service name when just one such service should be declared by the SP.
35+
# Comment out or set to empty if no Attribute Consuming Service should be declared, or if multiple ones should (see below).
3636
# The service name is mandatory.
3737
onelogin.saml2.sp.attribute_consuming_service.name = My service
3838

39-
# Attribute Consuming Service description when just one ACS should be declared by the SP.
39+
# Attribute Consuming Service description when just one such service should be declared by the SP.
4040
# Ignored if the previous property is commented or empty.
4141
# The service description is optional.
4242
onelogin.saml2.sp.attribute_consuming_service.description = My service description
4343

44-
# Language used for Attribute Consuming Service name and description when just one ACS should be declared by the SP.
44+
# Language used for Attribute Consuming Service name and description when just one such service should be declared by the SP.
4545
# Ignored if the name property is commented or empty.
4646
# The language is optional and default to "en" (English).
4747
onelogin.saml2.sp.attribute_consuming_service.lang = en
4848

49-
# Attributes to be included in the Attribute Consuming Service when just one ACS should be declared by the SP.
49+
# Attributes to be included in the Attribute Consuming Service when just one such service should be declared by the SP.
5050
# These are indexed properties, starting from 0. The index is used only to enumerate and sort attributes, but it's required.
5151
# The following properties allow to define each attribute:
5252
# - name: mandatory

core/src/test/resources/config/config.all_multi_attribute_consuming_services.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,24 @@ onelogin.saml2.sp.single_logout_service.binding = urn:oasis:names:tc:SAML:2.0:bi
3131
# Take a look on lib/Saml2/Constants.php to see the NameIdFormat supported
3232
onelogin.saml2.sp.nameidformat = urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
3333

34-
# THE FOLLOWING PROPERTIES FOR SINGLE ACS MUST BE IGNORED - MULTIPLE SERVICES DEFINED LATER
34+
# THE FOLLOWING PROPERTIES FOR SINGLE ATTRIBUTE CONSUMING SERVICE MUST BE IGNORED - MULTIPLE SERVICES DEFINED LATER
3535

36-
# Attribute Consuming Service name when just one ACS should be declared by the SP.
37-
# Comment out or set to empty if no ACS should be declared, or if multiple ones should (see below).
36+
# Attribute Consuming Service name when just one such service should be declared by the SP.
37+
# Comment out or set to empty if no Attribute Consuming Service should be declared, or if multiple ones should (see below).
3838
# The service name is mandatory.
3939
onelogin.saml2.sp.attribute_consuming_service.name = My service
4040

41-
# Attribute Consuming Service description when just one ACS should be declared by the SP.
41+
# Attribute Consuming Service description when just one such service should be declared by the SP.
4242
# Ignored if the previous property is commented or empty.
4343
# The service description is optional.
4444
onelogin.saml2.sp.attribute_consuming_service.description = My service description
4545

46-
# Language used for Attribute Consuming Service name and description when just one ACS should be declared by the SP.
46+
# Language used for Attribute Consuming Service name and description when just one such service should be declared by the SP.
4747
# Ignored if the name property is commented or empty.
4848
# The language is optional and default to "en" (English).
4949
onelogin.saml2.sp.attribute_consuming_service.lang = en
5050

51-
# Attributes to be included in the Attribute Consuming Service when just one ACS should be declared by the SP.
51+
# Attributes to be included in the Attribute Consuming Service when just one such service should be declared by the SP.
5252
# These are indexed properties, starting from 0. The index is used only to enumerate and sort attributes, but it's required.
5353
# The following properties allow to define each attribute:
5454
# - name: mandatory

core/src/test/resources/config/config.min_multi_attribute_consuming_services.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ onelogin.saml2.sp.assertion_consumer_service.url = http://localhost:8080/java-sa
1010
# URL Location where the <LogoutResponse> from the IdP will be returned or where to send the <LogoutRequest>
1111
onelogin.saml2.sp.single_logout_service.url = http://localhost:8080/java-saml-jspsample/sls.jsp
1212

13-
# Attributes to be included in the Attribute Consuming Service when just one ACS should be declared by the SP.
13+
# Attributes to be included in the Attribute Consuming Service when just one such service should be declared by the SP.
1414
# These are indexed properties, starting from 0. The index is used only to enumerate and sort attributes, but it's required.
1515
# The following properties allow to define each attribute:
1616
# - name: mandatory

0 commit comments

Comments
 (0)