mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-805: Only reformat a URL fragment that appears to be from OpenID Connect if the fragment is not already in a format consumable by AngularJS ("#?..." or "#/?...").
This commit is contained in:
@@ -18,19 +18,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Before AngularJS routing takes effect, test whether the URL fragment
|
* Before AngularJS routing takes effect, reformat the URL fragment
|
||||||
* contains an OpenID Connect "id_token" parameter, and reformat the fragment
|
* from the format used by OpenID Connect ("#param1=value1¶m2=value2&...")
|
||||||
* such that the client side of Guacamole's authentication system will
|
* to the format used by AngularJS ("#/?param1=value1¶m2=value2&...") such
|
||||||
* automatically forward the "id_token" value for server-side validation.
|
* that the client side of Guacamole's authentication system will automatically
|
||||||
|
* forward the "id_token" value for server-side validation.
|
||||||
*
|
*
|
||||||
* Note that not all OpenID identity providers will include the "id_token"
|
* Note that not all OpenID identity providers will include the "id_token"
|
||||||
* parameter in the first position; it may occur after several other parameters
|
* parameter in the first position; it may occur after several other parameters
|
||||||
* within the hash.
|
* within the fragment.
|
||||||
*/
|
*/
|
||||||
(function guacOpenIDTransformToken() {
|
(function guacOpenIDTransformToken() {
|
||||||
|
if (/^#(?![?\/])(.*&)?id_token=/.test(location.hash))
|
||||||
// Transform "/#id_token=..." to "/#/?id_token=..."
|
|
||||||
if (/(^#|&)id_token=/.test(location.hash))
|
|
||||||
location.hash = '/?' + location.hash.substring(1);
|
location.hash = '/?' + location.hash.substring(1);
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
Reference in New Issue
Block a user