public void handleStatusResponseType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { // Handler a log out response from IDP StatusResponseType statusResponseType = (StatusResponseType) request.getSAML2Object(); HTTPContext httpContext = (HTTPContext) request.getContext(); HttpServletRequest servletRequest = httpContext.getRequest(); HttpSession session = servletRequest.getSession(false); // TODO: Deal with partial logout report StatusType statusType = statusResponseType.getStatus(); StatusCodeType statusCode = statusType.getStatusCode(); URI statusCodeValueURI = statusCode.getValue(); boolean success = false; if(statusCodeValueURI != null){ String statusCodeValue = statusCodeValueURI.toString(); if(JBossSAMLURIConstants.STATUS_SUCCESS.get().equals(statusCodeValue)){ success = true; } } if(success){ // we are successfully logged out session.invalidate(); } else { StatusCodeType secondLevelstatusCode = statusCode.getStatusCode(); if (secondLevelstatusCode != null && secondLevelstatusCode.getValue().toString().equals(JBossSAMLURIConstants.STATUS_SUCCESS.get())) { // we are successfully logged out session.invalidate(); } } }
public void handleStatusResponseType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { //Handler a log out response from IDP StatusResponseType statusResponseType = (StatusResponseType) request.getSAML2Object(); HTTPContext httpContext = (HTTPContext) request.getContext(); HttpServletRequest servletRequest = httpContext.getRequest(); HttpSession session = servletRequest.getSession(false); //TODO: Deal with partial logout report StatusType statusType = statusResponseType.getStatus(); StatusCodeType statusCode = statusType.getStatusCode(); StatusCodeType secondLevelstatusCode = statusCode.getStatusCode(); if (secondLevelstatusCode.getValue().toString().equals(JBossSAMLURIConstants.STATUS_SUCCESS.get())) { //we are successfully logged out session.invalidate(); } }
public void handleStatusResponseType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { //Handler a log out response from IDP StatusResponseType statusResponseType = (StatusResponseType) request.getSAML2Object(); HTTPContext httpContext = (HTTPContext) request.getContext(); HttpServletRequest servletRequest = httpContext.getRequest(); HttpSession session = servletRequest.getSession(false); //TODO: Deal with partial logout report StatusType statusType = statusResponseType.getStatus(); StatusCodeType statusCode = statusType.getStatusCode(); StatusCodeType secondLevelstatusCode = statusCode.getStatusCode(); if (secondLevelstatusCode.getValue().toString().equals(JBossSAMLURIConstants.STATUS_SUCCESS.get())) { //we are successfully logged out session.invalidate(); } }
public void processIDPResponse(HttpServletRequest httpRequest, HttpServletResponse httpResponse, StatusResponseType response, RequestContext requestContext, SamlIdentityProvider idp) { if (response.getStatus() != null && response.getStatus().getStatusCode().getValue().equals(JBossSAMLURIConstants.STATUS_SUCCESS.get())) { Identity.instance().logout(); } else { throw new RuntimeException("Single logout failed. Status code: " + (response.getStatus() == null ? "null" : response.getStatus().getStatusCode().getValue())); } try { httpResponse.sendRedirect(serviceProvider.getLoggedOutUrl()); } catch (IOException e) { throw new RuntimeException(e); } } }
public void handleStatusResponseType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { // Handler a log out response from IDP StatusResponseType statusResponseType = (StatusResponseType) request.getSAML2Object(); checkDestination(statusResponseType.getDestination(), getSPConfiguration().getServiceURL()); HTTPContext httpContext = (HTTPContext) request.getContext(); HttpServletRequest servletRequest = httpContext.getRequest(); HttpSession session = servletRequest.getSession(false); // TODO: Deal with partial logout report StatusType statusType = statusResponseType.getStatus(); StatusCodeType statusCode = statusType.getStatusCode(); URI statusCodeValueURI = statusCode.getValue(); boolean success = false; if (statusCodeValueURI != null) { String statusCodeValue = statusCodeValueURI.toString(); if (JBossSAMLURIConstants.STATUS_SUCCESS.get().equals(statusCodeValue)) { success = true; session.invalidate(); } } }
public void handleStatusResponseType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { // Handler a log out response from IDP StatusResponseType statusResponseType = (StatusResponseType) request.getSAML2Object(); checkDestination(statusResponseType.getDestination(), getSPConfiguration().getServiceURL()); HTTPContext httpContext = (HTTPContext) request.getContext(); HttpServletRequest servletRequest = httpContext.getRequest(); HttpSession session = servletRequest.getSession(false); // TODO: Deal with partial logout report StatusType statusType = statusResponseType.getStatus(); StatusCodeType statusCode = statusType.getStatusCode(); URI statusCodeValueURI = statusCode.getValue(); boolean success = false; if (statusCodeValueURI != null) { String statusCodeValue = statusCodeValueURI.toString(); if (JBossSAMLURIConstants.STATUS_SUCCESS.get().equals(statusCodeValue)) { success = true; session.invalidate(); } } }
throw new IllegalArgumentException(ErrorCodes.NULL_VALUE + "Status Type from the IDP"); String statusValue = statusType.getStatusCode().getValue().toASCIIString(); if (JBossSAMLURIConstants.STATUS_SUCCESS.get().equals(statusValue) == false) throw new SecurityException(ErrorCodes.IDP_AUTH_FAILED + "IDP forbid the user");
throw new IllegalArgumentException(ErrorCodes.NULL_VALUE + "Status Type from the IDP"); String statusValue = statusType.getStatusCode().getValue().toASCIIString(); if (JBossSAMLURIConstants.STATUS_SUCCESS.get().equals(statusValue) == false) throw new SecurityException(ErrorCodes.IDP_AUTH_FAILED + "IDP forbid the user");
throw new IllegalArgumentException(ErrorCodes.NULL_VALUE + "Status Type from the IDP"); //$NON-NLS-1$ String statusValue = statusType.getStatusCode().getValue().toASCIIString(); if (JBossSAMLURIConstants.STATUS_SUCCESS.get().equals(statusValue) == false) throw new SecurityException(ErrorCodes.IDP_AUTH_FAILED + "IDP forbid the user"); //$NON-NLS-1$
throw new IllegalArgumentException(ErrorCodes.NULL_VALUE + "Status Type from the IDP"); String statusValue = statusType.getStatusCode().getValue().toASCIIString(); if (JBossSAMLURIConstants.STATUS_SUCCESS.get().equals(statusValue) == false) throw new SecurityException(ErrorCodes.IDP_AUTH_FAILED + "IDP forbid the user");
/** * Write a {@code StatusCodeType} to stream * * @param statusCodeType * @param out * @throws ProcessingException */ public void write(StatusCodeType statusCodeType) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_CODE.get(), PROTOCOL_NSURI.get()); URI value = statusCodeType.getValue(); if (value != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.VALUE.get(), value.toASCIIString()); } StatusCodeType subStatusCode = statusCodeType.getStatusCode(); if (subStatusCode != null) write(subStatusCode); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
String statusValue = status.getStatusCode().getValue(); if (JBossSAMLURIConstants.STATUS_SUCCESS.get().equals(statusValue) == false)
/** * Write a {@code StatusCodeType} to stream * @param statusCodeType * @param out * @throws ProcessingException */ public void write(StatusCodeType statusCodeType) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_CODE.get(), PROTOCOL_NSURI.get()); URI value = statusCodeType.getValue(); if (value != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.VALUE.get(), value.toASCIIString()); } StatusCodeType subStatusCode = statusCodeType.getStatusCode(); if (subStatusCode != null) write(subStatusCode); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Write a {@code StatusCodeType} to stream * * @param statusCodeType * @param out * * @throws ProcessingException */ public void write(StatusCodeType statusCodeType) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_CODE.get(), PROTOCOL_NSURI.get()); URI value = statusCodeType.getValue(); if (value != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.VALUE.get(), value.toASCIIString()); } StatusCodeType subStatusCode = statusCodeType.getStatusCode(); if (subStatusCode != null) write(subStatusCode); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Write a {@code StatusCodeType} to stream * @param statusCodeType * @param out * @throws ProcessingException */ public void write(StatusCodeType statusCodeType) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_CODE.get(), PROTOCOL_NSURI.get()); URI value = statusCodeType.getValue(); if (value != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.VALUE.get(), value.toASCIIString()); } StatusCodeType subStatusCode = statusCodeType.getStatusCode(); if (subStatusCode != null) write(subStatusCode); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Write a {@code StatusCodeType} to stream * * @param statusCodeType * @param out * * @throws ProcessingException */ public void write(StatusCodeType statusCodeType) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_CODE.get(), PROTOCOL_NSURI.get()); URI value = statusCodeType.getValue(); if (value != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.VALUE.get(), value.toASCIIString()); } StatusCodeType subStatusCode = statusCodeType.getStatusCode(); if (subStatusCode != null) write(subStatusCode); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "Status Type from the IDP"); String statusValue = statusType.getStatusCode().getValue().toASCIIString(); if (JBossSAMLURIConstants.STATUS_SUCCESS.get().equals(statusValue) == false) throw new SecurityException(ErrorCodes.IDP_AUTH_FAILED + "IDP forbid the user");
throw logger.nullArgumentError("Status Type from the IDP"); String statusValue = statusType.getStatusCode().getValue().toASCIIString(); if (JBossSAMLURIConstants.STATUS_SUCCESS.get().equals(statusValue) == false) throw logger.samlHandlerIDPAuthenticationFailedError();
throw logger.nullArgumentError("Status Type from the IDP"); String statusValue = statusType.getStatusCode().getValue().toASCIIString(); if (JBossSAMLURIConstants.STATUS_SUCCESS.get().equals(statusValue) == false) throw logger.samlHandlerIDPAuthenticationFailedError();
throw logger.nullArgumentError("Status Type from the IDP"); String statusValue = statusType.getStatusCode().getValue().toASCIIString(); if (JBossSAMLURIConstants.STATUS_SUCCESS.get().equals(statusValue) == false) throw logger.samlHandlerIDPAuthenticationFailedError();