summaryrefslogtreecommitdiffstats
path: root/shiro/src/main/java/org
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2019-02-23 09:21:01 -0600
committerInstrumental <jonathan.gathman@att.com>2019-02-23 09:21:21 -0600
commitb169754b801f8a7f8790796cf666f2c2ed6b5e1a (patch)
tree3df23cc5338235ab8520b0368eaf49cf4d155be8 /shiro/src/main/java/org
parent004851a114cc06933368ffe55fd58f0d010debb0 (diff)
Testing final edition, Shiro
Issue-ID: AAF-771 Change-Id: Ia86066e986a92756ad5ac9210fbdb4002de0bb23 Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'shiro/src/main/java/org')
-rw-r--r--shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFRealm.java23
1 files changed, 9 insertions, 14 deletions
diff --git a/shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFRealm.java b/shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFRealm.java
index dbc57d7..c455a4d 100644
--- a/shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFRealm.java
+++ b/shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFRealm.java
@@ -24,11 +24,9 @@ import java.io.IOException;
import java.security.Principal;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.Set;
import java.util.TreeMap;
import org.apache.shiro.authc.AuthenticationException;
@@ -61,7 +59,7 @@ public class AAFRealm extends AuthorizingRealm {
private static class Singleton {
private AAFCon<?> acon;
private AAFAuthn<?> authn;
- private Set<Class<? extends AuthenticationToken>> supports;
+// private Set<Class<? extends AuthenticationToken>> supports;
private AAFLurPerm authz;
private MapBathConverter mbc;
private Map<String,String> idMap;
@@ -82,7 +80,7 @@ public class AAFRealm extends AuthorizingRealm {
final String csv = access.getProperty(Config.CADI_BATH_CONVERT);
if(csv!=null) {
try {
- mbc = new MapBathConverter(access, new CSV(csv));
+ mbc = new MapBathConverter(access, new CSV(access,csv));
access.log(Level.INFO, "MapBathConversion enabled with file ",csv);
idMap = Collections.synchronizedMap(new TreeMap<String,String>());
// Load
@@ -104,7 +102,6 @@ public class AAFRealm extends AuthorizingRealm {
}
}
idMap.put(oldID,newID);
-
}
} catch (IOException e) {
access.log(e);
@@ -116,8 +113,10 @@ public class AAFRealm extends AuthorizingRealm {
throw new RuntimeException(msg,e);
}
}
- supports = Collections.synchronizedSet(new HashSet<>());
- supports.add(UsernamePasswordToken.class);
+
+ // There is only one of these. If there are more, put back
+// supports = Collections.synchronizedSet(new HashSet<>());
+// supports.add(UsernamePasswordToken.class);
}
public static synchronized Singleton singleton() {
@@ -265,21 +264,15 @@ public class AAFRealm extends AuthorizingRealm {
@Override
protected void assertCredentialsMatch(AuthenticationToken atoken, AuthenticationInfo ai)throws AuthenticationException {
-
if(ai instanceof AAFAuthenticationInfo) {
if(!((AAFAuthenticationInfo)ai).matches(atoken)) {
throw new AuthenticationException("Credentials do not match");
}
-
} else {
throw new AuthenticationException("AuthenticationInfo is not an AAFAuthenticationInfo");
-
}
}
-
-
-
@Override
protected AAFAuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
Principal bait = (Principal)principals.getPrimaryPrincipal();
@@ -303,7 +296,9 @@ public class AAFRealm extends AuthorizingRealm {
@Override
public boolean supports(AuthenticationToken token) {
- return singleton.supports.contains(token.getClass());
+ // Only one was being loaded. If more are needed uncomment the multi-class mode
+ return UsernamePasswordToken.class.equals(token);
+// return singleton.supports.contains(token.getClass());
}
@Override