diff --git a/extensions/guacamole-auth-openid/src/main/java/org/apache/guacamole/auth/oauth/OAuthCodeField.java b/extensions/guacamole-auth-openid/src/main/java/org/apache/guacamole/auth/oauth/OAuthCodeField.java index 6f4e4689c..bdf16c850 100644 --- a/extensions/guacamole-auth-openid/src/main/java/org/apache/guacamole/auth/oauth/OAuthCodeField.java +++ b/extensions/guacamole-auth-openid/src/main/java/org/apache/guacamole/auth/oauth/OAuthCodeField.java @@ -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 { diff --git a/extensions/guacamole-auth-openid/src/main/resources/guac-manifest.json b/extensions/guacamole-auth-openid/src/main/resources/guac-manifest.json index 77dd70922..e8f2facc1 100644 --- a/extensions/guacamole-auth-openid/src/main/resources/guac-manifest.json +++ b/extensions/guacamole-auth-openid/src/main/resources/guac-manifest.json @@ -7,6 +7,15 @@ "authProviders" : [ "org.apache.guacamole.auth.oauth.OAuthAuthenticationProvider" - ] + ], + + "js" : [ + "oauthModule.js", + "oauthConfig.js" + ], + + "resources" : { + "oauthCodeField.html" : "text/html" + } } diff --git a/extensions/guacamole-auth-openid/src/main/resources/oauthCodeField.html b/extensions/guacamole-auth-openid/src/main/resources/oauthCodeField.html new file mode 100644 index 000000000..e6c4fff04 --- /dev/null +++ b/extensions/guacamole-auth-openid/src/main/resources/oauthCodeField.html @@ -0,0 +1 @@ +Log in using OAuth \ No newline at end of file diff --git a/extensions/guacamole-auth-openid/src/main/resources/oauthConfig.js b/extensions/guacamole-auth-openid/src/main/resources/oauthConfig.js new file mode 100644 index 000000000..ba6f0cc88 --- /dev/null +++ b/extensions/guacamole-auth-openid/src/main/resources/oauthConfig.js @@ -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' + }); + +}]); diff --git a/extensions/guacamole-auth-openid/src/main/resources/oauthModule.js b/extensions/guacamole-auth-openid/src/main/resources/oauthModule.js new file mode 100644 index 000000000..545b6b79c --- /dev/null +++ b/extensions/guacamole-auth-openid/src/main/resources/oauthModule.js @@ -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');