GUACAMOLE-204: Implementation of CAS SSO module for Guacamole authentication.

This commit is contained in:
Nick Couchman
2017-02-10 08:59:37 -05:00
committed by Nick Couchman
parent 1c197ae467
commit b278970076
19 changed files with 1277 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/* Hide login dialog */
.login-ui div.login-dialog {
display: none;
}

View File

@@ -0,0 +1,51 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* Config block which registers CAS-specific field types.
*/
angular.module('guacCAS').config(['formServiceProvider',
function guacCASConfig(formServiceProvider) {
// Define field for ticket from CAS service
formServiceProvider.registerFieldType("GUAC_CAS_TICKET", {
templateUrl : '',
controller : 'guacCASController',
module : 'guacCAS'
});
}]);
/**
* Config block which augments the existing routing, providing special handling
* for the "ticket=" fragments provided by OpenID Connect.
*/
angular.module('index').config(['$routeProvider',
function indexRouteConfig($routeProvider) {
var curPath = window.location.href;
var ticketPos = curPath.indexOf("?ticket=") + 8;
var hashPos = curPath.indexOf("#/");
if(ticketPos > 0 && ticketPos < hashPos) {
var ticket = curPath.substring(ticketPos, hashPos);
var newPath = curPath.substring(0,ticketPos - 8) + '#/?ticket=' + ticket;
window.location=newPath;
}
}]);

View File

@@ -0,0 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* Controller for the "GUAC_CAS_TICKET" field which simply redirects the user
* immediately to the authorization URI.
*/
angular.module('guacCAS').controller('guacCASController', ['$scope',
function guacCASController($scope) {
// Redirect to authorization URI
window.location = $scope.field.authorizationURI;
}]);

View File

@@ -0,0 +1,29 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* Module which provides handling for CAS authentication.
*/
angular.module('guacCAS', [
'form',
'ngRoute',
]);
// Ensure the CAS module is loaded along with the rest of the app
angular.module('index').requires.push('guacCAS');

View File

@@ -0,0 +1,22 @@
{
"guacamoleVersion" : "0.9.11-incubating",
"name" : "CAS Authentication Extension",
"namespace" : "guac-cas",
"authProviders" : [
"org.apache.guacamole.auth.cas.CASAuthenticationProvider"
],
"js" : [
"casModule.js",
"casController.js",
"casConfig.js"
],
"css" : [
"cas.css"
]
}