, / , , .
, , .
, WebSphere, , ( ) :
public AuthStatus validateRequest(MessageInfo messageInfo, Subject clientSubject,
Subject serviceSubject) throws AuthException {
String uniqueid = "test";
String username = "test";
String password = "test";
Hashtable hashtable = new Hashtable();
hashtable.put(AttributeNameConstants.WSCREDENTIAL_UNIQUEID, uniqueid);
hashtable.put(AttributeNameConstants.WSCREDENTIAL_SECURITYNAME, username);
hashtable.put(AttributeNameConstants.WSCREDENTIAL_PASSWORD, password);
List groups = new ArrayList();
groups.add("testers");
hashtable.put(AttributeNameConstants.WSCREDENTIAL_GROUPS, groups);
hashtable.put(AttributeNameConstants.WSCREDENTIAL_CACHE_KEY, "myCustomAttribute" + uniqueid);
clientSubject.getPrivateCredentials().add(hashtable);
return AuthStatus.SUCCESS;
}
, . , . , application.xml, :
<security-role>
<role-name>user</role-name>
</security-role>
, /. ibm-application-bnd.xml:
<?xml version="1.0" encoding="UTF-8"?>
<application-bnd xmlns="http://websphere.ibm.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-application-bnd_1_2.xsd"
version="1.2">
<security-role name="user">
<user name="test" access-id="user:defaultWIMFileBasedRealm/test"/>
<group name="testers" access-id="group:defaultWIMFileBasedRealm/testers"/>
<special-subject type="ALL_AUTHENTICATED_USERS" />
</security-role>
</application-bnd>
, , :
user -group -special-subject - , .
, /, access-id, , name.
. :