Tabnine Logo
JBossSAMLConstants
Code IndexAdd Tabnine to your IDE (free)

How to use
JBossSAMLConstants
in
org.keycloak.saml.common.constants

Best Java code snippets using org.keycloak.saml.common.constants.JBossSAMLConstants (Showing top 5 results out of 315)

origin: org.keycloak/keycloak-saml-core-public

/**
 * Returns an enum constant based if known for the given {@code key}, or the {@code UNKNOWN_VALUE} otherwise.
 * @param key
 * @return
 */
public static JBossSAMLConstants from(String key) {
  return from(key, UNKNOWN_VALUE);
}
origin: org.keycloak/keycloak-saml-adapter-core

private Element getAssertionFromResponse(final SAMLDocumentHolder responseHolder) throws ConfigurationException, ProcessingException {
  Element encryptedAssertion = DocumentUtil.getElement(responseHolder.getSamlDocument(), new QName(JBossSAMLConstants.ENCRYPTED_ASSERTION.get()));
  if (encryptedAssertion != null) {
    // encrypted assertion.
    // We'll need to decrypt it first.
    Document encryptedAssertionDocument = DocumentUtil.createDocument();
    encryptedAssertionDocument.appendChild(encryptedAssertionDocument.importNode(encryptedAssertion, true));
    return XMLEncryptionUtil.decryptElementInDocument(encryptedAssertionDocument, deployment.getDecryptionKey());
  }
  return DocumentUtil.getElement(responseHolder.getSamlDocument(), new QName(JBossSAMLConstants.ASSERTION.get()));
}
origin: org.keycloak/keycloak-saml-adapter-core

public MultivaluedHashMap<String, KeyInfo> parse(InputStream stream) throws ParsingException {
  MultivaluedHashMap<String, KeyInfo> res = new MultivaluedHashMap<>();
  try {
    DocumentBuilder builder = DocumentUtil.getDocumentBuilder();
    Document doc = builder.parse(stream);
    XPathExpression expr = xpath.compile("/m:EntitiesDescriptor/m:EntityDescriptor/m:IDPSSODescriptor/m:KeyDescriptor");
    NodeList keyDescriptors = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
    for (int i = 0; i < keyDescriptors.getLength(); i ++) {
      Node keyDescriptor = keyDescriptors.item(i);
      Element keyDescriptorEl = (Element) keyDescriptor;
      KeyInfo ki = processKeyDescriptor(keyDescriptorEl);
      if (ki != null) {
        String use = keyDescriptorEl.getAttribute(JBossSAMLConstants.USE.get());
        res.add(use, ki);
      }
    }
  } catch (SAXException | IOException | ParserConfigurationException | MarshalException | XPathExpressionException e) {
    throw new ParsingException("Error parsing SAML descriptor", e);
  }
  return res;
}
origin: org.keycloak/keycloak-saml-adapter-core

private void createPaosRequestHeader(SOAPEnvelope envelope) throws SOAPException {
  SOAPHeader headers = envelope.getHeader();
  SOAPHeaderElement paosRequestHeader = headers.addHeaderElement(envelope.createQName(JBossSAMLConstants.REQUEST.get(), NS_PREFIX_PAOS_BINDING));
  paosRequestHeader.setMustUnderstand(true);
  paosRequestHeader.setActor("http://schemas.xmlsoap.org/soap/actor/next");
  paosRequestHeader.addAttribute(envelope.createName("service"), JBossSAMLURIConstants.ECP_PROFILE.get());
  paosRequestHeader.addAttribute(envelope.createName("responseConsumerURL"), getResponseConsumerUrl());
}
origin: org.keycloak/keycloak-saml-adapter-core

private void createEcpRequestHeader(SOAPEnvelope envelope) throws SOAPException {
  SOAPHeader headers = envelope.getHeader();
  SOAPHeaderElement ecpRequestHeader = headers.addHeaderElement(envelope.createQName(JBossSAMLConstants.REQUEST.get(), NS_PREFIX_PROFILE_ECP));
  ecpRequestHeader.setMustUnderstand(true);
  ecpRequestHeader.setActor("http://schemas.xmlsoap.org/soap/actor/next");
  ecpRequestHeader.addAttribute(envelope.createName("ProviderName"), deployment.getEntityID());
  ecpRequestHeader.addAttribute(envelope.createName("IsPassive"), "0");
  ecpRequestHeader.addChildElement(envelope.createQName("Issuer", "saml")).setValue(deployment.getEntityID());
  ecpRequestHeader.addChildElement(envelope.createQName("IDPList", "samlp"))
      .addChildElement(envelope.createQName("IDPEntry", "samlp"))
      .addAttribute(envelope.createName("ProviderID"), deployment.getIDP().getEntityID())
      .addAttribute(envelope.createName("Name"), deployment.getIDP().getEntityID())
      .addAttribute(envelope.createName("Loc"), deployment.getIDP().getSingleSignOnService().getRequestBindingUrl());
}
org.keycloak.saml.common.constantsJBossSAMLConstants

Javadoc

SAML Constants

Most used methods

  • from
    Returns an enum constant based if known for the given name (namespace-aware), or the UNKNOWN_VALUE o
  • get

Popular in Java

  • Running tasks concurrently on multiple threads
  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • requestLocationUpdates (LocationManager)
  • Permission (java.security)
    Legacy security code; do not use.
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JTable (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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