...
| XML element |
Query parameter |
Callback class |
Supported version |
| authenticationType |
wauth |
WAuthCallback |
1.0.0 |
| homeRealm |
whr |
HomeRealmCallback |
1.0.0 |
| issuer |
N.A. |
IDPCallback |
1.0.0 |
| freshness |
wfresh |
FreshnessCallback |
1.0.2 |
| realm |
wtrealm |
RealmCallback |
1.1.0 |
| N.A. |
any |
SignInQueryCallback |
1.1.0 |
| request |
wreq |
WReqCallback |
1.1.1 |
If you configure a class which implements the interface javax.security.auth.callback.CallbackHandler you get the corresponding Callback object where you must set the value which is then added to the query parameter. The Callback object provides the HttpServletRequest object which might give you the required information to resolve the value.
Here is a snippet of the configuration to configure a CallbackHandler:
Code Block |
...
<protocol xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="federationProtocolType" version="1.2">
...
<homeRealm type="Class" value="MyCallbackHandler " />
...
</protocol>
...
|
And a sample implementation of the CallbackHandler:
Code Block |
public class MyCallbackHandler implements CallbackHandler {
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
for (int i = 0; i < callbacks.length; i++) {
if (callbacks[i] instanceof HomeRealmCallback) {
HomeRealmCallback callback = (HomeRealmCallback) callbacks[i];
HttpServletRequest request = callback.getRequest();
String homeRealm = ...
callback.setHomeRealm(homeRealm);
} else {
throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback");
}
}
}
}
|
...