mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-103: Merge usability improvements to handling of SAML entity ID property.
This commit is contained in:
@@ -45,7 +45,7 @@ public class ConfigurationService {
|
|||||||
* The URI of the file containing the XML Metadata associated with the
|
* The URI of the file containing the XML Metadata associated with the
|
||||||
* SAML IdP.
|
* SAML IdP.
|
||||||
*/
|
*/
|
||||||
private static final URIGuacamoleProperty SAML_IDP_METADATA =
|
private static final URIGuacamoleProperty SAML_IDP_METADATA_URL =
|
||||||
new URIGuacamoleProperty() {
|
new URIGuacamoleProperty() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -159,11 +159,10 @@ public class ConfigurationService {
|
|||||||
* The URL to send to the SAML IdP as the Client Identifier.
|
* The URL to send to the SAML IdP as the Client Identifier.
|
||||||
*
|
*
|
||||||
* @throws GuacamoleException
|
* @throws GuacamoleException
|
||||||
* If guacamole.properties cannot be parsed, or if the
|
* If guacamole.properties cannot be parsed.
|
||||||
* property is missing.
|
|
||||||
*/
|
*/
|
||||||
private URI getEntityId() throws GuacamoleException {
|
private URI getEntityId() throws GuacamoleException {
|
||||||
return environment.getRequiredProperty(SAML_ENTITY_ID);
|
return environment.getProperty(SAML_ENTITY_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -183,7 +182,7 @@ public class ConfigurationService {
|
|||||||
* metadata is missing.
|
* metadata is missing.
|
||||||
*/
|
*/
|
||||||
private URI getIdpMetadata() throws GuacamoleException {
|
private URI getIdpMetadata() throws GuacamoleException {
|
||||||
return environment.getProperty(SAML_IDP_METADATA);
|
return environment.getProperty(SAML_IDP_METADATA_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -209,8 +208,8 @@ public class ConfigurationService {
|
|||||||
* be POSTed to upon completion of SAML authentication.
|
* be POSTed to upon completion of SAML authentication.
|
||||||
*
|
*
|
||||||
* @throws GuacamoleException
|
* @throws GuacamoleException
|
||||||
* If guacamole.properties cannot be parsed, or if the
|
* If guacamole.properties cannot be parsed, or the property
|
||||||
* callback parameter is missing.
|
* is missing.
|
||||||
*/
|
*/
|
||||||
public URI getCallbackUrl() throws GuacamoleException {
|
public URI getCallbackUrl() throws GuacamoleException {
|
||||||
return environment.getRequiredProperty(SAML_CALLBACK_URL);
|
return environment.getRequiredProperty(SAML_CALLBACK_URL);
|
||||||
@@ -334,7 +333,11 @@ public class ConfigurationService {
|
|||||||
|
|
||||||
// Read entity ID from properties if not provided within metadata XML
|
// Read entity ID from properties if not provided within metadata XML
|
||||||
if (!samlMap.containsKey(SettingsBuilder.SP_ENTITYID_PROPERTY_KEY)) {
|
if (!samlMap.containsKey(SettingsBuilder.SP_ENTITYID_PROPERTY_KEY)) {
|
||||||
samlMap.put(SettingsBuilder.SP_ENTITYID_PROPERTY_KEY, getEntityId().toString());
|
URI entityId = getEntityId();
|
||||||
|
if (entityId == null)
|
||||||
|
throw new GuacamoleServerException("SAML Entity ID was not found"
|
||||||
|
+ " in either the metadata XML file or guacamole.properties");
|
||||||
|
samlMap.put(SettingsBuilder.SP_ENTITYID_PROPERTY_KEY, entityId.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Derive ACS URL from properties if not provided within metadata XML
|
// Derive ACS URL from properties if not provided within metadata XML
|
||||||
|
Reference in New Issue
Block a user