use of com.sun.enterprise.security.jauth.jaspic.provider.ServerAuthConfig in project Payara by payara.
the class SecurityServiceImpl method validateRequest.
@Override
public boolean validateRequest(Object serverAuthConfig, StreamingHandler implementor, SOAPMessageContext context) {
ServerAuthConfig authConfig = (ServerAuthConfig) serverAuthConfig;
if (authConfig == null) {
return true;
}
ServerAuthContext serverAuthContext = authConfig.getAuthContext(implementor, context.getMessage());
req.set(new WeakReference<SOAPMessage>(context.getMessage()));
if (serverAuthContext == null) {
return true;
}
try {
return WebServiceSecurity.validateRequest(context, serverAuthContext);
} catch (AuthException ex) {
_logger.log(SEVERE, EXCEPTION_THROWN, ex);
if (req.get() != null) {
req.get().clear();
req.set(null);
}
throw new RuntimeException(ex);
}
}
use of com.sun.enterprise.security.jauth.jaspic.provider.ServerAuthConfig in project Payara by payara.
the class SecurityServiceImpl method secureResponse.
@Override
public void secureResponse(Object serverAuthConfig, StreamingHandler implementor, SOAPMessageContext msgContext) {
if (serverAuthConfig != null) {
ServerAuthConfig config = (ServerAuthConfig) serverAuthConfig;
SOAPMessage reqmsg = (req.get() != null) ? req.get().get() : msgContext.getMessage();
try {
ServerAuthContext serverAuthContext = config.getAuthContext(implementor, reqmsg);
if (serverAuthContext != null) {
try {
WebServiceSecurity.secureResponse(msgContext, serverAuthContext);
} catch (AuthException ex) {
_logger.log(SEVERE, EXCEPTION_THROWN, ex);
throw new RuntimeException(ex);
}
}
} finally {
if (req.get() != null) {
req.get().clear();
req.set(null);
}
}
}
}
Aggregations