By enabling
identity assertion with trust validation, an
application can use the JAAS login configuration to perform a programmatic
identity assertion.
About this task
To enable an identity
assertion with trust validation, follow
these steps:
What to do next
An application can now use the
JAAS login configuration to
perform a programmatic identity assertion. The application can create
a login context for the JAAS configuration created in step 2, then
login to that login context with the identity it asserts to. If the
login is successful, that identity can be set in the current running
process, as in the following example:
MyCallbackHandler handler = new MyCallbackHandler(new MyPrincipal(“Joe”));
LoginContext lc = new LoginContext(“MyAppLoginConfig”, handler);
lc.login(); //assume successful
Subject s = lc.getSubject();
WSSubject.setRunAsSubject(s);
// From here on, the runas identity is “Joe”