Here is a method you could use inside a login module. It assumes you extend the
AbstractServerLoginModule.
| private Object[] getLoginInfo() throws LoginException {
|
| if (callbackHandler == null) {
| log.warn("No callbackHandler available");
| throw new LoginException(
| "Error: no CallbackHandler available " + "to collect
authentication information");
| }
| String username = null;
| X509Certificate[] certs = null;
| NameCallback nc = new NameCallback("username");
| ObjectCallback oc = new ObjectCallback("certs");
| Callback[] callbacks = { nc, oc };
| try {
| callbackHandler.handle(callbacks);
| username = nc.getName();
|
| Object credential = oc.getCredential();
| if (credential == null || !(credential instanceof X509Certificate[])) {
| log.debug("No X509Certficate chain");
| throw new LoginException("No X509Certficate chain");
| }
| certs = (X509Certificate[]) credential;
| } catch (java.io.IOException ioe) {
| throw new LoginException(ioe.toString());
| } catch (UnsupportedCallbackException uce) {
| throw new LoginException("CallbackHandler does not support: " +
uce.getCallback());
| }
| return new Object[] { username, certs };
| }
|
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3834837#3834837
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3834837
-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user