Repository: usergrid
Updated Branches:
  refs/heads/master 691d6b2ec -> cf0b65366


Fixes issue with organization credentials using the same cache key when the 
credentials cache is enabled.


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

Branch: refs/heads/master
Commit: cf0b65366b18eb11635d11a5ad13e2870d31a10f
Parents: 691d6b2
Author: Michael Russo <mru...@apigee.com>
Authored: Fri Feb 10 10:57:56 2017 -0800
Committer: Michael Russo <mru...@apigee.com>
Committed: Fri Feb 10 10:57:56 2017 -0800

----------------------------------------------------------------------
 .../java/org/apache/usergrid/security/shiro/ShiroCache.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/cf0b6536/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCache.java
----------------------------------------------------------------------
diff --git 
a/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCache.java
 
b/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCache.java
index 6c5ac6c..48062f9 100644
--- 
a/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCache.java
+++ 
b/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCache.java
@@ -209,7 +209,12 @@ public class ShiroCache<K, V> implements Cache<K,V> {
                     if (p.getAccessTokenCredentials() != null) {
                         ret = p.getAccessTokenCredentials().getToken() + "_" + 
typeName;
                     } else {
-                        ret = p.getApplicationId() + "_" + typeName;
+                        if (p instanceof OrganizationPrincipal){
+                            OrganizationPrincipal op = (OrganizationPrincipal) 
p;
+                            ret = op.getOrganizationId() + "_" + typeName;
+                        }else{
+                            ret = p.getApplicationId() + "_" + typeName;
+                        }
                     }
 
                 } else {

Reply via email to