You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by vn...@apache.org on 2017/09/27 02:17:58 UTC

[06/29] incubator-guacamole-client git commit: GUACAMOLE-210: Add OAuth code/link field.

GUACAMOLE-210: Add OAuth code/link field.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/89f25a94
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/89f25a94
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/89f25a94

Branch: refs/heads/master
Commit: 89f25a9467b62545bd1c114a35bba8680678fcc6
Parents: c7d5bd6
Author: Michael Jumper <mj...@apache.org>
Authored: Sat Jan 2 00:22:08 2016 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Mon Sep 25 13:06:42 2017 -0700

----------------------------------------------------------------------
 .../guacamole/auth/oauth/OAuthCodeField.java    |  2 +-
 .../src/main/resources/guac-manifest.json       | 11 ++++++-
 .../src/main/resources/oauthCodeField.html      |  1 +
 .../src/main/resources/oauthConfig.js           | 31 ++++++++++++++++++++
 .../src/main/resources/oauthModule.js           | 28 ++++++++++++++++++
 5 files changed, 71 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/89f25a94/extensions/guacamole-auth-openid/src/main/java/org/apache/guacamole/auth/oauth/OAuthCodeField.java
----------------------------------------------------------------------
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 6f4e468..bdf16c8 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 {

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/89f25a94/extensions/guacamole-auth-openid/src/main/resources/guac-manifest.json
----------------------------------------------------------------------
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 77dd709..e8f2fac 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"
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/89f25a94/extensions/guacamole-auth-openid/src/main/resources/oauthCodeField.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 0000000..e6c4fff
--- /dev/null
+++ b/extensions/guacamole-auth-openid/src/main/resources/oauthCodeField.html
@@ -0,0 +1 @@
+<a href="{{field.authorizationURI}}">Log in using OAuth</a>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/89f25a94/extensions/guacamole-auth-openid/src/main/resources/oauthConfig.js
----------------------------------------------------------------------
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 0000000..ba6f0cc
--- /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'
+    });
+
+}]);

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/89f25a94/extensions/guacamole-auth-openid/src/main/resources/oauthModule.js
----------------------------------------------------------------------
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 0000000..545b6b7
--- /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');