Methods Summary |
---|
public java.lang.String[] | authenticate(java.lang.String username, java.lang.String password)Invoke the native authentication call.
String[] grps = nativeAuthenticate(username, password);
if(grps != null){
grps = addAssignGroups(grps);
}
setGroupNames(username, grps);
return grps;
|
public java.lang.String | getAuthType()Returns a short (preferably less than fifteen characters) description
of the kind of authentication which is supported by this realm.
return AUTH_TYPE;
|
public java.util.Enumeration | getGroupNames(java.lang.String username)Returns the name of all the groups that this user belongs to.
This is called from web path role verification, though
it should not be.
Vector v = (Vector)groupCache.get(username);
if (v == null) {
v = loadGroupNames(username);
}
return v.elements();
|
public synchronized void | init(java.util.Properties props)Initialize a realm with some properties. This can be used
when instantiating realms from their descriptions. This
method may only be called a single time.
// Library for native methods
System.loadLibrary("solarisauth");
super.init(props);
String jaasCtx = props.getProperty(IASRealm.JAAS_CONTEXT_PARAM);
if (jaasCtx == null) {
if (_logger.isLoggable(Level.WARNING)) {
_logger.warning("realmconfig.noctx");
}
String msg = sm.getString("solarisrealm.nojaas");
throw new BadRealmException(msg);
}
this.setProperty(IASRealm.JAAS_CONTEXT_PARAM, jaasCtx);
if (_logger.isLoggable(Level.FINE)) {
_logger.fine("SolarisRealm : "+IASRealm.JAAS_CONTEXT_PARAM+
"="+jaasCtx);
}
groupCache = new HashMap();
emptyVector = new Vector();
|
private java.util.Vector | loadGroupNames(java.lang.String username)Loads groups names for the given user by calling native method.
Group info is loaded when user authenticates, however in some
cases (such as run-as) the group membership info is needed
without an authentication event.
String[] grps = nativeGetGroups(username);
if (grps == null) {
_logger.fine("No groups returned for user: "+username);
}
grps = addAssignGroups(grps);
setGroupNames(username, grps);
return (Vector)groupCache.get(username);
|
private static native java.lang.String[] | nativeAuthenticate(java.lang.String user, java.lang.String password)Native method. Authenticate using PAM.
|
private static native java.lang.String[] | nativeGetGroups(java.lang.String user)Native method. Retrieve Solaris groups for user.
|
private void | setGroupNames(java.lang.String username, java.lang.String[] groups)Set group membership info for a user.
See bugs 4646133,4646270 on why this is here.
Vector v = null;
if (groups == null) {
v = emptyVector;
} else {
v = new Vector(groups.length + 1);
for (int i=0; i<groups.length; i++) {
v.add(groups[i]);
}
}
synchronized (this) {
groupCache.put(username, v);
}
|