Package org.opensaml.xml.security.credential

Examples of org.opensaml.xml.security.credential.Credential


    CriteriaSet criteriaSet = new CriteriaSet();
    criteriaSet.add(new EntityIDCriteria(openSAMLContext.entityId()));
    criteriaSet.add(new UsageCriteria(UsageType.SIGNING));
    try {

      Credential signingCredential = openSAMLContext.keyStoreCredentialResolver().resolveSingle(criteriaSet);
      String relayState = authState;
      LOG.debug("Sending authnRequest to {}", target);
      openSAMLContext.samlMessageHandler().sendSAMLMessage(authnRequest, endpoint, response, relayState, signingCredential);
    } catch (MessageEncodingException mee) {
      LOG.error("Could not send authnRequest to Identity Provider.", mee);
View Full Code Here


        // Now process all (non-KeyValue) children
        processKeyInfoChildren(kiContext, criteriaSet, credentials);

        if (credentials.isEmpty() && keyValueKey != null) {
            // Add the credential based on plain KeyValue if no more specifc cred type was found
            Credential keyValueCredential = buildBasicCredential(keyValueKey, keyNames);
            if (keyValueCredential != null) {
                log.debug("No credentials were extracted by registered non-KeyValue handling providers, "
                        + "adding KeyValue credential to returned credential set");
                credentials.add(keyValueCredential);
            }
View Full Code Here

    }

    /** {@inheritDoc} */
    public void evaluate(MessageContext messageContext) throws SecurityPolicyException {

        Credential peerCredential = messageContext.getInboundMessageTransport().getPeerCredential();

        if (peerCredential == null) {
            log.info("Inbound message transport did not contain a peer credential, "
                    + "skipping client certificate authentication");
            return;
View Full Code Here

        SAMLObject outboundMessage = messageContext.getOutboundSAMLMessage();
        if (outboundMessage instanceof SignableSAMLObject
                && messageContext.getOuboundSAMLMessageSigningCredential() != null) {
            log.debug("Signing outbound SAML message.");
            SignableSAMLObject signableMessage = (SignableSAMLObject) outboundMessage;
            Credential signingCredential = messageContext.getOuboundSAMLMessageSigningCredential();

            XMLObjectBuilder<Signature> signatureBuilder = Configuration.getBuilderFactory().getBuilder(
                    Signature.DEFAULT_ELEMENT_NAME);
            Signature signature = signatureBuilder.buildObject(Signature.DEFAULT_ELEMENT_NAME);
            signature.setSigningCredential(signingCredential);
View Full Code Here

    }

    /** {@inheritDoc} */
    public void evaluate(MessageContext messageContext) throws SecurityPolicyException {

        Credential peerCredential = messageContext.getInboundMessageTransport().getPeerCredential();

        if (peerCredential == null) {
            log.info("Inbound message transport did not contain a peer credential, "
                    + "skipping client certificate authentication");
            return;
View Full Code Here

        // Now process all (non-KeyValue) children
        processKeyInfoChildren(kiContext, criteriaSet, credentials);

        if (credentials.isEmpty() && keyValueKey != null) {
            // Add the credential based on plain KeyValue if no more specifc cred type was found
            Credential keyValueCredential = buildBasicCredential(keyValueKey, keyNames);
            if (keyValueCredential != null) {
                log.debug("No credentials were extracted by registered non-KeyValue handling providers, "
                        + "adding KeyValue credential to returned credential set");
                credentials.add(keyValueCredential);
            }
View Full Code Here

     * @throws MessageEncodingException thrown if there is a problem marshalling or signing the outbound message
     */
    @SuppressWarnings("unchecked")
    protected void signMessage(SAMLMessageContext messageContext) throws MessageEncodingException {
        SAMLObject outboundSAML = messageContext.getOutboundSAMLMessage();
        Credential signingCredential = messageContext.getOuboundSAMLMessageSigningCredential();

        if (outboundSAML instanceof SignableSAMLObject && signingCredential != null) {
            SignableSAMLObject signableMessage = (SignableSAMLObject) outboundSAML;

            XMLObjectBuilder<Signature> signatureBuilder = Configuration.getBuilderFactory().getBuilder(
View Full Code Here

        // Now process all (non-KeyValue) children
        processKeyInfoChildren(kiContext, criteriaSet, credentials);

        if (credentials.isEmpty() && keyValueKey != null) {
            // Add the credential based on plain KeyValue if no more specifc cred type was found
            Credential keyValueCredential = buildBasicCredential(keyValueKey, keyNames);
            if (keyValueCredential != null) {
                log.debug("No credentials were extracted by registered non-KeyValue handling providers, "
                        + "adding KeyValue credential to returned credential set");
                credentials.add(keyValueCredential);
            }
View Full Code Here

        SAMLObject outboundMessage = messageContext.getOutboundSAMLMessage();
        if (outboundMessage instanceof SignableSAMLObject
                && messageContext.getOuboundSAMLMessageSigningCredential() != null) {
            log.debug("Signing outbound SAML message.");
            SignableSAMLObject signableMessage = (SignableSAMLObject) outboundMessage;
            Credential signingCredential = messageContext.getOuboundSAMLMessageSigningCredential();

            XMLObjectBuilder<Signature> signatureBuilder = Configuration.getBuilderFactory().getBuilder(
                    Signature.DEFAULT_ELEMENT_NAME);
            Signature signature = signatureBuilder.buildObject(Signature.DEFAULT_ELEMENT_NAME);
            signature.setSigningCredential(signingCredential);
View Full Code Here

        String relayState = messagesContext.getRelayState();
        if (checkRelayState(relayState)) {
            queryParams.add(new Pair<String, String>("RelayState", relayState));
        }

        Credential signingCredential = messagesContext.getOuboundSAMLMessageSigningCredential();
        if (signingCredential != null) {
            // TODO pull SecurityConfiguration from SAMLMessageContext? needs to be added
            String sigAlgURI = getSignatureAlgorithmURI(signingCredential, null);
            Pair<String, String> sigAlg = new Pair<String, String>("SigAlg", sigAlgURI);
            queryParams.add(sigAlg);
View Full Code Here

TOP

Related Classes of org.opensaml.xml.security.credential.Credential

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.