usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mru...@apache.org
Subject [04/50] [abbrv] usergrid git commit: Allow UG to inject this class even if public key URL is not specified because external SSO is disabled.
Date Mon, 01 Aug 2016 16:53:39 GMT
Allow UG to inject this class even if public key URL is not specified because external SSO
is disabled.


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/37642347
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/37642347
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/37642347

Branch: refs/heads/master
Commit: 37642347b684cedd657101073f7a6b512300d83a
Parents: 71cbd8e
Author: Michael Russo <mrusso@apigee.com>
Authored: Mon Jun 27 13:38:33 2016 -0700
Committer: Michael Russo <mrusso@apigee.com>
Committed: Mon Jun 27 13:38:33 2016 -0700

----------------------------------------------------------------------
 .../apache/usergrid/security/sso/ApigeeSSO2Provider.java  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/37642347/stack/services/src/main/java/org/apache/usergrid/security/sso/ApigeeSSO2Provider.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/sso/ApigeeSSO2Provider.java
b/stack/services/src/main/java/org/apache/usergrid/security/sso/ApigeeSSO2Provider.java
index f35e546..de10591 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/sso/ApigeeSSO2Provider.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/sso/ApigeeSSO2Provider.java
@@ -64,8 +64,14 @@ public class ApigeeSSO2Provider implements ExternalSSOProvider {
     }
 
     private String getPublicKey() {
-        Map<String, Object> publicKey = client.target(properties.getProperty(USERGRID_EXTERNAL_PUBLICKEY_URL)).request().get(Map.class);
-        return publicKey.get(RESPONSE_PUBLICKEY_VALUE).toString().split("----\n")[1].split("\n---")[0];
+
+        final String keyUrl = properties.getProperty(USERGRID_EXTERNAL_PUBLICKEY_URL);
+        if(keyUrl != null && !keyUrl.isEmpty()) {
+            Map<String, Object> publicKey = client.target(properties.getProperty(USERGRID_EXTERNAL_PUBLICKEY_URL)).request().get(Map.class);
+            return publicKey.get(RESPONSE_PUBLICKEY_VALUE).toString().split("----\n")[1].split("\n---")[0];
+        }
+
+        return null;
     }
 
     @Override


Mime
View raw message