mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-457: include CAS login URI when requesting auth ticket
This commit is contained in:
@@ -40,6 +40,12 @@ public class CASTicketField extends Field {
|
|||||||
*/
|
*/
|
||||||
public static final String PARAMETER_NAME = "ticket";
|
public static final String PARAMETER_NAME = "ticket";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The standard URI name for the CAS login resource.
|
||||||
|
*/
|
||||||
|
private static final String CAS_LOGIN_URI = "login";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The full URI which the field should link to.
|
* The full URI which the field should link to.
|
||||||
*/
|
*/
|
||||||
@@ -57,11 +63,6 @@ public class CASTicketField extends Field {
|
|||||||
* The full URL of the endpoint accepting CAS authentication
|
* The full URL of the endpoint accepting CAS authentication
|
||||||
* requests.
|
* requests.
|
||||||
*
|
*
|
||||||
* @param clientID
|
|
||||||
* The ID of the CAS client. This is normally determined ahead of
|
|
||||||
* time by the CAS service through some manual credential request
|
|
||||||
* procedure.
|
|
||||||
*
|
|
||||||
* @param redirectURI
|
* @param redirectURI
|
||||||
* The URI that the CAS service should redirect to upon successful
|
* The URI that the CAS service should redirect to upon successful
|
||||||
* authentication.
|
* authentication.
|
||||||
@@ -73,8 +74,16 @@ public class CASTicketField extends Field {
|
|||||||
|
|
||||||
// Build authorization URI from given values
|
// Build authorization URI from given values
|
||||||
try {
|
try {
|
||||||
this.authorizationURI = authorizationEndpoint
|
final StringBuilder sb = new StringBuilder();
|
||||||
+ "?service=" + URLEncoder.encode(redirectURI, "UTF-8");
|
sb.append(authorizationEndpoint);
|
||||||
|
// user might configure the endpoint with a trailing slash
|
||||||
|
if (sb.charAt(sb.length() - 1) != '/') {
|
||||||
|
sb.append('/');
|
||||||
|
}
|
||||||
|
sb.append(CAS_LOGIN_URI);
|
||||||
|
sb.append("?service=");
|
||||||
|
sb.append(URLEncoder.encode(redirectURI, "UTF-8"));
|
||||||
|
this.authorizationURI = sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Java is required to provide UTF-8 support
|
// Java is required to provide UTF-8 support
|
||||||
|
Reference in New Issue
Block a user