mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-210: Add OAuth code/link field.
This commit is contained in:
@@ -65,7 +65,7 @@ public class OAuthCodeField extends Field {
|
||||
String redirectURI) {
|
||||
|
||||
// Init base field properties
|
||||
super(OAUTH_CODE_PARAMETER_NAME, "OAUTH_CODE");
|
||||
super(OAUTH_CODE_PARAMETER_NAME, "GUAC_OAUTH_CODE");
|
||||
|
||||
// Build authorization URI from given values
|
||||
try {
|
||||
|
@@ -7,6 +7,15 @@
|
||||
|
||||
"authProviders" : [
|
||||
"org.apache.guacamole.auth.oauth.OAuthAuthenticationProvider"
|
||||
]
|
||||
],
|
||||
|
||||
"js" : [
|
||||
"oauthModule.js",
|
||||
"oauthConfig.js"
|
||||
],
|
||||
|
||||
"resources" : {
|
||||
"oauthCodeField.html" : "text/html"
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1 @@
|
||||
<a href="{{field.authorizationURI}}">Log in using OAuth</a>
|
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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 OAuth-specific field types.
|
||||
*/
|
||||
angular.module('guacOAuth').config(['formServiceProvider',
|
||||
function guacOAuthConfig(formServiceProvider) {
|
||||
|
||||
// Define field for code from OAuth service
|
||||
formServiceProvider.registerFieldType("GUAC_OAUTH_CODE", {
|
||||
templateUrl : 'app/ext/guac-oauth/oauthCodeField.html'
|
||||
});
|
||||
|
||||
}]);
|
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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 OAuth authentication.
|
||||
*/
|
||||
angular.module('guacOAuth', [
|
||||
'form'
|
||||
]);
|
||||
|
||||
// Ensure the OAuth module is loaded along with the rest of the app
|
||||
angular.module('index').requires.push('guacOAuth');
|
Reference in New Issue
Block a user