usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mru...@apache.org
Subject [4/4] usergrid git commit: Merge branch 'release-2.1.1'
Date Wed, 02 Mar 2016 21:34:33 GMT
Merge branch 'release-2.1.1'


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

Branch: refs/heads/master
Commit: 40faf7ec07e5ec76d61e25163f8a8f113fa8c013
Parents: bf3d426 e15cb12
Author: Michael Russo <mrusso@apigee.com>
Authored: Wed Mar 2 13:34:09 2016 -0800
Committer: Michael Russo <mrusso@apigee.com>
Committed: Wed Mar 2 13:34:09 2016 -0800

----------------------------------------------------------------------
 .../rest/management/ManagementResourceIT.java   | 49 ++++++++++++++++++++
 .../tokens/cassandra/TokenServiceImpl.java      | 16 ++++---
 2 files changed, 59 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/40faf7ec/stack/services/src/main/java/org/apache/usergrid/security/tokens/cassandra/TokenServiceImpl.java
----------------------------------------------------------------------
diff --cc stack/services/src/main/java/org/apache/usergrid/security/tokens/cassandra/TokenServiceImpl.java
index 8bbb60f,3f046e2..8bfd8a4
--- a/stack/services/src/main/java/org/apache/usergrid/security/tokens/cassandra/TokenServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/tokens/cassandra/TokenServiceImpl.java
@@@ -324,16 -322,20 +322,22 @@@ public class TokenServiceImpl implement
  
          UUID uuid = getUUIDForToken( token );
  
 +        long ssoTtl = 1000000L; // TODO: property for this
 +
          if ( uuid == null ) {
 -            return null;
 +            return isSSOEnabled() ? validateExternalToken( token, ssoTtl ) : null;
          }
  
-         TokenInfo tokenInfo = getTokenInfo( uuid );
- 
-         if ( tokenInfo == null ) {
-             return isSSOEnabled() ? validateExternalToken( token, ssoTtl ) : null;
+         TokenInfo tokenInfo;
+         try {
+             tokenInfo = getTokenInfo( uuid );
+         } catch (InvalidTokenException e){
+             // now try from central sso
+             if ( isSSOEnabled() ){
+                 return validateExternalToken( token, maxPersistenceTokenAge );
+             }else{
+                 throw e; // re-throw the error
+             }
          }
  
          //update the token


Mime
View raw message