/** * Parse the attributes at the log out request element * @param startElement * @return * @throws ParsingException */ private LogoutRequestType parseBaseAttributes(StartElement startElement) throws ParsingException { super.parseRequiredAttributes(startElement); LogoutRequestType logoutRequest = new LogoutRequestType(id, issueInstant); //Let us get the attributes super.parseBaseAttributes(startElement, logoutRequest); Attribute reason = startElement.getAttributeByName(new QName(JBossSAMLConstants.REASON.get())); if (reason != null) logoutRequest.setReason(StaxParserUtil.getAttributeValue(reason)); Attribute notOnOrAfter = startElement.getAttributeByName(new QName(JBossSAMLConstants.NOT_ON_OR_AFTER.get())); if (notOnOrAfter != null) logoutRequest.setNotOnOrAfter(XMLTimeUtil.parse(StaxParserUtil.getAttributeValue(notOnOrAfter))); return logoutRequest; } }
/** * Parse the attributes at the log out request element * * @param startElement * @return * @throws ParsingException */ private LogoutRequestType parseBaseAttributes(StartElement startElement) throws ParsingException { super.parseRequiredAttributes(startElement); LogoutRequestType logoutRequest = new LogoutRequestType(id, issueInstant); // Let us get the attributes super.parseBaseAttributes(startElement, logoutRequest); Attribute reason = startElement.getAttributeByName(new QName(JBossSAMLConstants.REASON.get())); if (reason != null) logoutRequest.setReason(StaxParserUtil.getAttributeValue(reason)); Attribute notOnOrAfter = startElement.getAttributeByName(new QName(JBossSAMLConstants.NOT_ON_OR_AFTER.get())); if (notOnOrAfter != null) logoutRequest.setNotOnOrAfter(XMLTimeUtil.parse(StaxParserUtil.getAttributeValue(notOnOrAfter))); return logoutRequest; } }
/** * Parse the attributes at the log out request element * @param startElement * @return * @throws ParsingException */ private LogoutRequestType parseBaseAttributes(StartElement startElement) throws ParsingException { super.parseRequiredAttributes(startElement); LogoutRequestType logoutRequest = new LogoutRequestType(id, issueInstant); //Let us get the attributes super.parseBaseAttributes(startElement, logoutRequest); Attribute reason = startElement.getAttributeByName(new QName(JBossSAMLConstants.REASON.get())); if (reason != null) logoutRequest.setReason(StaxParserUtil.getAttributeValue(reason)); Attribute notOnOrAfter = startElement.getAttributeByName(new QName(JBossSAMLConstants.NOT_ON_OR_AFTER.get())); if (notOnOrAfter != null) logoutRequest.setNotOnOrAfter(XMLTimeUtil.parse(StaxParserUtil.getAttributeValue(notOnOrAfter))); return logoutRequest; } }
/** * Parse the attributes at the log out request element * * @param startElement * * @return * * @throws ParsingException */ private LogoutRequestType parseBaseAttributes(StartElement startElement) throws ParsingException { super.parseRequiredAttributes(startElement); LogoutRequestType logoutRequest = new LogoutRequestType(id, issueInstant); // Let us get the attributes super.parseBaseAttributes(startElement, logoutRequest); Attribute reason = startElement.getAttributeByName(new QName(JBossSAMLConstants.REASON.get())); if (reason != null) logoutRequest.setReason(StaxParserUtil.getAttributeValue(reason)); Attribute notOnOrAfter = startElement.getAttributeByName(new QName(JBossSAMLConstants.NOT_ON_OR_AFTER.get())); if (notOnOrAfter != null) logoutRequest.setNotOnOrAfter(XMLTimeUtil.parse(StaxParserUtil.getAttributeValue(notOnOrAfter))); return logoutRequest; } }
/** * Parse the attributes at the log out request element * * @param startElement * * @return * * @throws ParsingException */ private LogoutRequestType parseBaseAttributes(StartElement startElement) throws ParsingException { super.parseRequiredAttributes(startElement); LogoutRequestType logoutRequest = new LogoutRequestType(id, issueInstant); // Let us get the attributes super.parseBaseAttributes(startElement, logoutRequest); Attribute reason = startElement.getAttributeByName(new QName(JBossSAMLConstants.REASON.get())); if (reason != null) logoutRequest.setReason(StaxParserUtil.getAttributeValue(reason)); Attribute notOnOrAfter = startElement.getAttributeByName(new QName(JBossSAMLConstants.NOT_ON_OR_AFTER.get())); if (notOnOrAfter != null) logoutRequest.setNotOnOrAfter(XMLTimeUtil.parse(StaxParserUtil.getAttributeValue(notOnOrAfter))); return logoutRequest; } }
private LogoutRequestType createLogoutRequest(SAML2HandlerRequest request, String participant) throws ConfigurationException, ProcessingException { HTTPContext httpContext = (HTTPContext) request.getContext(); HttpServletRequest httpServletRequest = httpContext.getRequest(); LogoutRequestType lort = new SAML2Request().createLogoutRequest(request.getIssuer().getValue()); Principal userPrincipal = httpServletRequest.getUserPrincipal(); if (userPrincipal == null) { throw logger.samlHandlerPrincipalNotFoundError(); } NameIDType nameID = new NameIDType(); nameID.setValue(userPrincipal.getName()); //Deal with NameID Format String nameIDFormat = (String) handlerConfig.getParameter(GeneralConstants.NAMEID_FORMAT); if (StringUtil.isNullOrEmpty(nameIDFormat)) { nameIDFormat = JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get(); } nameID.setFormat(URI.create(nameIDFormat)); lort.setNameID(nameID); long assertionValidity = PicketLinkCoreSTS.instance().getConfiguration().getIssuedTokenTimeout(); lort.setNotOnOrAfter(XMLTimeUtil.add(lort.getIssueInstant(), assertionValidity)); lort.setDestination(URI.create(participant)); return lort; }
private LogoutRequestType createLogoutRequest(SAML2HandlerRequest request, String participant) throws ConfigurationException, ProcessingException { HTTPContext httpContext = (HTTPContext) request.getContext(); HttpServletRequest httpServletRequest = httpContext.getRequest(); LogoutRequestType lort = new SAML2Request().createLogoutRequest(request.getIssuer().getValue()); Principal userPrincipal = httpServletRequest.getUserPrincipal(); if (userPrincipal == null) { throw logger.samlHandlerPrincipalNotFoundError(); } NameIDType nameID = new NameIDType(); nameID.setValue(userPrincipal.getName()); //Deal with NameID Format String nameIDFormat = (String) handlerConfig.getParameter(GeneralConstants.NAMEID_FORMAT); if (StringUtil.isNullOrEmpty(nameIDFormat)) { nameIDFormat = JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get(); } nameID.setFormat(URI.create(nameIDFormat)); lort.setNameID(nameID); long assertionValidity = PicketLinkCoreSTS.instance().getConfiguration().getIssuedTokenTimeout(); lort.setNotOnOrAfter(XMLTimeUtil.add(lort.getIssueInstant(), assertionValidity)); lort.setDestination(URI.create(participant)); return lort; }
lort.setNotOnOrAfter(XMLTimeUtil.add(lort.getIssueInstant(), assertionValidity)); lort.setDestination(URI.create(participant));
lort.setNotOnOrAfter(XMLTimeUtil.add(lort.getIssueInstant(), assertionValidity)); lort.setDestination(URI.create(participant));
lort.setNotOnOrAfter(XMLTimeUtil.add(lort.getIssueInstant(), assertionValidity)); lort.setDestination(URI.create(participant));