Everything,
Can anyone give some advice on how to use the JCAS LoginContext for authentication against multiple KDC / Realm combinations. In other words, if attempt 1 fails against area A, try area B.
Something like pseudo code below.
As always, any help is appreciated.
view plaincopy for clipboardprint?
[realms] some.address.for.auth.one { kdc = some.address.one } some.address.for.auth.two { kdc = some.address.two } boolean loginSuccess = false; try { LoginContext lc = new LoginContext(...); //Try Realm 1 lc.login(); loginSuccess = true; } catch(LoginException le) { try { LoginContext lc2 = new LoginContext(...); //Try Realm 2 lc2.login(); loginSuccess = true; } catch(LoginException le) { //... } } return loginSuccess;
source share