Tabnine Logo
LogoutRequestType.setNameID
Code IndexAdd Tabnine to your IDE (free)

How to use
setNameID
method
in
org.picketlink.identity.federation.saml.v2.protocol.LogoutRequestType

Best Java code snippets using org.picketlink.identity.federation.saml.v2.protocol.LogoutRequestType.setNameID (Showing top 19 results out of 315)

origin: org.picketlink/picketlink-federation

/**
 * <p>This method populate the request and session with a logout requests to start a global logout from the IdP.</p>
 *  @param request
 * @param userPrincipal
 */
private HttpServletRequestWrapper prepareLocalGlobalLogoutRequest(HttpServletRequest request, Principal userPrincipal) {
  try {
    SAML2Request saml2Request = new SAML2Request();
    LogoutRequestType lort = saml2Request.createLogoutRequest(getIdentityURL());
    NameIDType nameID = new NameIDType();
    nameID.setValue(userPrincipal.getName());
    nameID.setFormat(URI.create(JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get()));
    lort.setNameID(nameID);
    lort.setDestination(URI.create(getIdentityURL()));
    byte[] responseBytes = DocumentUtil.getDocumentAsString(saml2Request.convert(lort)).getBytes("UTF-8");
    final String samlRequest = RedirectBindingUtil.deflateBase64Encode(responseBytes);
    return new HttpServletRequestWrapper(request) {
      @Override
      public String getParameter(String name) {
        if (SAML_REQUEST_KEY.equals(name)) {
          return samlRequest;
        }
        return super.getParameter(name);
      }
    };
  } catch (Exception e) {
    throw new RuntimeException("Could not perform IdP Initiated Single Logout.", e);
  }
}
origin: picketlink/picketlink

/**
 * <p>This method populate the request and session with a logout requests to start a global logout from the IdP.</p>
 *  @param request
 * @param userPrincipal
 */
private HttpServletRequestWrapper prepareLocalGlobalLogoutRequest(HttpServletRequest request, Principal userPrincipal) {
  try {
    SAML2Request saml2Request = new SAML2Request();
    LogoutRequestType lort = saml2Request.createLogoutRequest(getIdentityURL());
    NameIDType nameID = new NameIDType();
    nameID.setValue(userPrincipal.getName());
    nameID.setFormat(URI.create(JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get()));
    lort.setNameID(nameID);
    lort.setDestination(URI.create(getIdentityURL()));
    byte[] responseBytes = DocumentUtil.getDocumentAsString(saml2Request.convert(lort)).getBytes("UTF-8");
    final String samlRequest = RedirectBindingUtil.deflateBase64Encode(responseBytes);
    return new HttpServletRequestWrapper(request) {
      @Override
      public String getParameter(String name) {
        if (SAML_REQUEST_KEY.equals(name)) {
          return samlRequest;
        }
        return super.getParameter(name);
      }
    };
  } catch (Exception e) {
    throw new RuntimeException("Could not perform IdP Initiated Single Logout.", e);
  }
}
origin: org.picketlink/picketlink-tomcat-common

/**
 * <p>This method populate the request and session with a logout requests to start a global logout from the IdP.</p>
 *
 * @param request
 * @param userPrincipal
 */
private void prepareLocalGlobalLogoutRequest(Request request, Principal userPrincipal) {
  try {
    SAML2Request saml2Request = new SAML2Request();
    LogoutRequestType lort = saml2Request.createLogoutRequest(getIdentityURL());
    NameIDType nameID = new NameIDType();
    nameID.setValue(userPrincipal.getName());
    nameID.setFormat(URI.create(JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get()));
    lort.setNameID(nameID);
    lort.setDestination(URI.create(getIdentityURL()));
    byte[] responseBytes = DocumentUtil.getDocumentAsString(saml2Request.convert(lort)).getBytes("UTF-8");
    String samlRequest = RedirectBindingUtil.deflateBase64Encode(responseBytes);
    Session session = request.getSessionInternal();
    session.setNote(SAML_REQUEST_KEY, samlRequest);
  } catch (Exception e) {
    throw new RuntimeException("Could not perform IdP Initiated Single Logout.", e);
  }
}
origin: org.picketlink.distribution/picketlink-jbas7

/**
 * <p>This method populate the request and session with a logout requests to start a global logout from the IdP.</p>
 *
 * @param request
 * @param userPrincipal
 */
private void prepareLocalGlobalLogoutRequest(Request request, Principal userPrincipal) {
  try {
    SAML2Request saml2Request = new SAML2Request();
    LogoutRequestType lort = saml2Request.createLogoutRequest(getIdentityURL());
    NameIDType nameID = new NameIDType();
    nameID.setValue(userPrincipal.getName());
    nameID.setFormat(URI.create(JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get()));
    lort.setNameID(nameID);
    lort.setDestination(URI.create(getIdentityURL()));
    byte[] responseBytes = DocumentUtil.getDocumentAsString(saml2Request.convert(lort)).getBytes("UTF-8");
    String samlRequest = RedirectBindingUtil.deflateBase64Encode(responseBytes);
    Session session = request.getSessionInternal();
    session.setNote(SAML_REQUEST_KEY, samlRequest);
  } catch (Exception e) {
    throw new RuntimeException("Could not perform IdP Initiated Single Logout.", e);
  }
}
origin: org.picketlink.distribution/picketlink-jbas5

/**
 * <p>This method populate the request and session with a logout requests to start a global logout from the IdP.</p>
 *
 * @param request
 * @param userPrincipal
 */
private void prepareLocalGlobalLogoutRequest(Request request, Principal userPrincipal) {
  try {
    SAML2Request saml2Request = new SAML2Request();
    LogoutRequestType lort = saml2Request.createLogoutRequest(getIdentityURL());
    NameIDType nameID = new NameIDType();
    nameID.setValue(userPrincipal.getName());
    nameID.setFormat(URI.create(JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get()));
    lort.setNameID(nameID);
    lort.setDestination(URI.create(getIdentityURL()));
    byte[] responseBytes = DocumentUtil.getDocumentAsString(saml2Request.convert(lort)).getBytes("UTF-8");
    String samlRequest = RedirectBindingUtil.deflateBase64Encode(responseBytes);
    Session session = request.getSessionInternal();
    session.setNote(SAML_REQUEST_KEY, samlRequest);
  } catch (Exception e) {
    throw new RuntimeException("Could not perform IdP Initiated Single Logout.", e);
  }
}
origin: org.picketlink/picketlink-fed

logoutRequest.setNameID(nameID);
origin: org.picketlink/picketlink-fed-core

logoutRequest.setNameID(nameID);
origin: picketlink/picketlink

lot.setNameID(nameID);
origin: org.picketlink/picketlink-core

} else if (JBossSAMLConstants.NAMEID.get().equals(elementName)) {
  NameIDType nameID = SAMLParserUtil.parseNameIDType(xmlEventReader);
  logoutRequest.setNameID(nameID);
} else if (JBossSAMLConstants.ISSUER.get().equals(elementName)) {
  continue;
origin: org.picketlink/picketlink-core

lot.setNameID(nameID);
origin: org.picketlink/picketlink-federation

lot.setNameID(nameID);
origin: org.picketlink/picketlink-federation

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;
}
origin: org.picketlink/picketlink-federation

} else if (JBossSAMLConstants.NAMEID.get().equals(elementName)) {
  NameIDType nameID = SAMLParserUtil.parseNameIDType(xmlEventReader);
  logoutRequest.setNameID(nameID);
} else if (JBossSAMLConstants.ISSUER.get().equals(elementName)) {
  continue;
origin: picketlink/picketlink

} else if (JBossSAMLConstants.NAMEID.get().equals(elementName)) {
  NameIDType nameID = SAMLParserUtil.parseNameIDType(xmlEventReader);
  logoutRequest.setNameID(nameID);
} else if (JBossSAMLConstants.ISSUER.get().equals(elementName)) {
  continue;
origin: picketlink/picketlink

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;
}
origin: org.picketlink/picketlink-core

lort.setNameID(nameID);
origin: org.picketlink/picketlink-federation

lort.setNameID(nameID);
origin: picketlink/picketlink

lort.setNameID(nameID);
origin: org.picketlink/picketlink-seam

public LogoutRequestType createLogoutRequest(SeamSamlPrincipal principal) throws ConfigurationException
{
 ObjectFactory objectFactory = new ObjectFactory();
 org.picketlink.identity.federation.saml.v2.assertion.ObjectFactory assertionObjectFactory = new org.picketlink.identity.federation.saml.v2.assertion.ObjectFactory();
 LogoutRequestType logoutRequest = objectFactory.createLogoutRequestType();
 logoutRequest.setID(generateId());
 logoutRequest.setIssueInstant(generateIssueInstant());
 NameIDType issuer = assertionObjectFactory.createNameIDType();
 issuer.setValue(serviceProvider.getSamlConfiguration().getEntityId());
 logoutRequest.setIssuer(issuer);
 NameIDType nameID = JBossSAMLBaseFactory.createNameID();
 nameID.setValue(principal.getNameId().getValue());
 logoutRequest.setNameID(nameID);
 logoutRequest.setVersion(JBossSAMLConstants.VERSION_2_0.get());
 logoutRequest.getSessionIndex().add(principal.getSessionIndex());
 return logoutRequest;
}
org.picketlink.identity.federation.saml.v2.protocolLogoutRequestTypesetNameID

Javadoc

Sets the value of the nameID property.

Popular methods of LogoutRequestType

  • setDestination
  • getID
  • getIssueInstant
  • getIssuer
  • getSessionIndex
    Gets the value of the sessionIndex property.
  • setNotOnOrAfter
    Sets the value of the notOnOrAfter property.
  • <init>
  • getConsent
  • getDestination
  • getNameID
    Gets the value of the nameID property.
  • getVersion
  • setIssuer
  • getVersion,
  • setIssuer,
  • setReason,
  • addSessionIndex,
  • getSignature,
  • setID,
  • setIssueInstant,
  • setVersion

Popular in Java

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (Timer)
  • getResourceAsStream (ClassLoader)
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • ImageIO (javax.imageio)
  • JList (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now