use of com.sun.enterprise.security.jmac.provider.PacketMessageInfo in project Payara by payara.
the class ClientSecurityPipe method startSecureConversation.
@Override
public JAXBElement startSecureConversation(Packet packet) throws WSSecureConversationException {
PacketMessageInfo info = new PacketMapMessageInfo(packet, new Packet());
JAXBElement token = null;
try {
// gets the subject from the packet (puts one there if not found)
Subject clientSubject = getClientSubject(packet);
// put MessageInfo in properties map, since MessageInfo
// is not passed to getAuthContext, key idicates function
HashMap map = new HashMap();
map.put(PipeConstants.SECURITY_TOKEN, info);
helper.getSessionToken(map, info, clientSubject);
// helper returns token in map of msgInfo, using same key
Object o = info.getMap().get(PipeConstants.SECURITY_TOKEN);
if (o != null && o instanceof JAXBElement) {
token = (JAXBElement) o;
}
} catch (Exception e) {
if (e instanceof WSSecureConversationException) {
throw (WSSecureConversationException) e;
} else {
throw new WSSecureConversationException("Secure Conversation failure: ", e);
}
}
return token;
}
use of com.sun.enterprise.security.jmac.provider.PacketMessageInfo in project Payara by payara.
the class ClientSecurityPipe method preDestroy.
@Override
public void preDestroy() {
// create a dummy request packet
try {
Packet request = new Packet();
PacketMessageInfo info = new PacketMapMessageInfo(request, new Packet());
Subject subj = getClientSubject(request);
ClientAuthContext cAC = helper.getClientAuthContext(info, subj);
if (cAC != null && WSIT_CLIENT_AUTH_CONTEXT.equals(cAC.getClass().getName())) {
cAC.cleanSubject(info, subj);
}
} catch (Exception ex) {
// ignore exceptions
}
helper.disable();
}
use of com.sun.enterprise.security.jmac.provider.PacketMessageInfo in project Payara by payara.
the class ClientSecurityTube method startSecureConversation.
@Override
public JAXBElement startSecureConversation(Packet packet) throws WSSecureConversationException {
PacketMessageInfo locInfo = new PacketMapMessageInfo(packet, new Packet());
JAXBElement token = null;
try {
// gets the subject from the packet (puts one there if not found)
Subject locClientSubject = getClientSubject(packet);
// put MessageInfo in properties map, since MessageInfo
// is not passed to getAuthContext, key idicates function
HashMap map = new HashMap();
map.put(PipeConstants.SECURITY_TOKEN, locInfo);
helper.getSessionToken(map, locInfo, locClientSubject);
// helper returns token in map of msgInfo, using same key
Object o = locInfo.getMap().get(PipeConstants.SECURITY_TOKEN);
if (o != null && o instanceof JAXBElement) {
token = (JAXBElement) o;
}
} catch (Exception e) {
if (e instanceof WSSecureConversationException) {
throw (WSSecureConversationException) e;
} else {
throw new WSSecureConversationException("Secure Conversation failure: ", e);
}
}
return token;
}
use of com.sun.enterprise.security.jmac.provider.PacketMessageInfo in project Payara by payara.
the class ClientSecurityTube method preDestroy.
@Override
public void preDestroy() {
// create a dummy request packet
try {
Packet request = new Packet();
PacketMessageInfo locInfo = new PacketMapMessageInfo(request, new Packet());
Subject subj = getClientSubject(request);
ClientAuthContext locCAC = helper.getClientAuthContext(locInfo, subj);
if (locCAC != null && WSIT_CLIENT_AUTH_CONTEXT.equals(locCAC.getClass().getName())) {
locCAC.cleanSubject(locInfo, subj);
}
} catch (Exception ex) {
// ignore exceptions
}
helper.disable();
}
use of com.sun.enterprise.security.jmac.provider.PacketMessageInfo in project Payara by payara.
the class CommonServerSecurityPipe method preDestroy.
/**
* This method is called once in server side and at most one in client side.
*/
@Override
public void preDestroy() {
helper.disable();
try {
Packet request = new Packet();
PacketMessageInfo info = new PacketMapMessageInfo(request, new Packet());
Subject subj = new Subject();
ServerAuthContext sAC = helper.getServerAuthContext(info, subj);
if (sAC != null && WSIT_SERVER_AUTH_CONTEXT.equals(sAC.getClass().getName())) {
sAC.cleanSubject(info, subj);
}
} catch (Exception ex) {
// ignore exceptions
}
/**
* Fix for bug 3932/4052
*/
next.preDestroy();
}
Aggregations