use of org.jboss.iiop.csiv2.SASCurrent in project wildfly by wildfly.
the class ElytronSASInitializer method pre_init.
@Override
public void pre_init(ORBInitInfo info) {
try {
// create and register the SASCurrent.
SASCurrent sasCurrent = new SASCurrentImpl();
info.register_initial_reference("SASCurrent", sasCurrent);
// the SASCurrent still needs to be initialized. Its initialization is deferred to post_init, as it needs
// to call resolve_initial_references.
} catch (InvalidName e) {
throw IIOPLogger.ROOT_LOGGER.errorRegisteringSASCurrentInitRef(e);
}
}
use of org.jboss.iiop.csiv2.SASCurrent in project wildfly by wildfly.
the class SASInitializer method pre_init.
@Override
public void pre_init(ORBInitInfo info) {
try {
// create and register the SASCurrent.
SASCurrent sasCurrent = new SASCurrentImpl();
info.register_initial_reference("SASCurrent", sasCurrent);
} catch (Exception e) {
throw IIOPLogger.ROOT_LOGGER.errorRegisteringSASCurrentInitRef(e);
}
}
use of org.jboss.iiop.csiv2.SASCurrent in project wildfly by wildfly.
the class TrustedIdentityTokenLoginModule method login.
@Override
@SuppressWarnings("unchecked")
public boolean login() throws LoginException {
// See if shared credentials exist
if (super.login() == true) {
// Setup our view of the user
Object username = sharedState.get("javax.security.auth.login.name");
if (username instanceof Principal)
identity = (Principal) username;
else {
String name = username.toString();
try {
identity = createIdentity(name);
} catch (Exception e) {
LoginException le = new LoginException();
le.initCause(e);
throw le;
}
}
return true;
}
super.loginOk = false;
if (callbackHandler == null) {
throw new LoginException();
}
SecurityAssociationCallback callback = new SecurityAssociationCallback();
Callback[] callbacks = { callback };
final String username;
try {
callbackHandler.handle(callbacks);
username = callback.getPrincipal().getName();
final Object c = callback.getCredential();
if (c instanceof SASCurrent) {
credential = (SASCurrent) c;
} else {
return false;
}
} catch (IOException e) {
LoginException le = new LoginException();
le.initCause(e);
throw le;
} catch (UnsupportedCallbackException e) {
LoginException le = new LoginException();
le.initCause(e);
throw le;
}
validateCredential(username, credential);
if (username == null) {
return false;
}
if (identity == null) {
try {
identity = createIdentity(username);
} catch (Exception e) {
LoginException le = new LoginException();
le.initCause(e);
throw le;
}
}
if (getUseFirstPass() == true) {
// Add the principal to the shared state map
sharedState.put("javax.security.auth.login.name", identity);
sharedState.put("javax.security.auth.login.password", credential);
}
super.loginOk = true;
return true;
}
use of org.jboss.iiop.csiv2.SASCurrent in project wildfly by wildfly.
the class SASClientInitializer method pre_init.
@Override
public void pre_init(ORBInitInfo info) {
try {
// create and register the SASCurrent.
SASCurrent sasCurrent = new SASCurrentImpl();
info.register_initial_reference("SASCurrent", sasCurrent);
// the SASCurrent still needs to be initialized. Its initialization is deferred to post_init, as it needs
// to call resolve_initial_references.
} catch (InvalidName e) {
throw IIOPLogger.ROOT_LOGGER.errorRegisteringSASCurrentInitRef(e);
}
}
Aggregations