Package org.jboss.identity.federation.saml.v2.assertion

Examples of org.jboss.identity.federation.saml.v2.assertion.NameIDType


        return null;
    }

    private NameIDType validateSubjectAndExtractNameID(AssertionType assertion) {
        NameIDType nameId = null;
        boolean validConfirmationFound = false;

        for (JAXBElement<?> contentElement : assertion.getSubject().getContent()) {
            if (contentElement.getValue() instanceof NameIDType) {
                nameId = (NameIDType) contentElement.getValue();
View Full Code Here


            throw new InvalidRequestException("Request should be a single logout request.");
        }

        LogoutRequestType logoutRequest = (LogoutRequestType) request;

        NameIDType nameIdJaxb = logoutRequest.getNameID();
        SamlNameId samlNameId = new SamlNameIdImpl(nameIdJaxb.getValue(), nameIdJaxb.getFormat(), nameIdJaxb.getNameQualifier());

        samlIdpIncomingLogoutDialogue.get().setNameId(samlNameId);
        samlIdpIncomingLogoutDialogue.get().setSessionIndexes(logoutRequest.getSessionIndex());

        removeNextSessionParticipant(httpResponse);
View Full Code Here

         throw new InvalidRequestException("Request should be a single logout request.");
      }

      LogoutRequestType logoutRequest = (LogoutRequestType) request;

      NameIDType nameIdJaxb = logoutRequest.getNameID();
      SamlNameId samlNameId = new SamlNameIdImpl(nameIdJaxb.getValue(), nameIdJaxb.getFormat(), nameIdJaxb.getNameQualifier());

      samlIdpIncomingLogoutDialogue.get().setNameId(samlNameId);
      samlIdpIncomingLogoutDialogue.get().setSessionIndexes(logoutRequest.getSessionIndex());

      removeNextSessionParticipant(httpResponse);
View Full Code Here

      {
         log.warn("Received assertion not processed because it doesn't contain a valid authnStatement.");
         return null;
      }

      NameIDType nameId = validateSubjectAndExtractNameID(assertion);
      if (nameId == null)
      {
         log.warn("Received assertion not processed because it doesn't contain a valid subject.");
         return null;
      }

      SamlPrincipalImpl principal = new SamlPrincipalImpl();
      principal.setAssertion(assertion);
      principal.setNameId(new SamlNameIdImpl(nameId.getValue(), nameId.getFormat(), nameId.getNameQualifier()));
      SamlSpSessionImpl session = new SamlSpSessionImpl();
      session.setSessionIndex(authnStatement.getSessionIndex());
      session.setPrincipal(principal);
      session.setIdentityProvider(idp);
View Full Code Here

      return null;
   }

   private NameIDType validateSubjectAndExtractNameID(AssertionType assertion)
   {
      NameIDType nameId = null;
      boolean validConfirmationFound = false;

      for (JAXBElement<?> contentElement : assertion.getSubject().getContent())
      {
         if (contentElement.getValue() instanceof NameIDType)
View Full Code Here

      }

      LogoutRequestType logoutRequest = (LogoutRequestType) request;
      SamlExternalIdentityProvider idp = (SamlExternalIdentityProvider) samlDialogue.getExternalProvider();

      NameIDType nameIdJaxb = logoutRequest.getNameID();
      SamlNameId samlNameId = new SamlNameIdImpl(nameIdJaxb.getValue(), nameIdJaxb.getFormat(), nameIdJaxb.getNameQualifier());
      removeSessions(samlNameId, idp.getEntityId(), logoutRequest.getSessionIndex());

      StatusResponseType statusResponse = samlMessageFactory.createStatusResponse(SamlConstants.STATUS_SUCCESS, null);

      samlMessageSender.sendResponse(idp, statusResponse, SamlProfile.SINGLE_LOGOUT, httpResponse);
View Full Code Here

      response.getAssertionOrEncryptedAssertion().add(assertion);

      SubjectType subject = assertionObjectFactory.createSubjectType();
      assertion.setSubject(subject);

      NameIDType nameID = assertionObjectFactory.createNameIDType();
      subject.getContent().add(assertionObjectFactory.createNameID(nameID));
      nameID.setValue(session.getPrincipal().getNameId().getValue());
      nameID.setFormat(session.getPrincipal().getNameId().getFormat());
      nameID.setNameQualifier(session.getPrincipal().getNameId().getQualifier());

      SubjectConfirmationType subjectConfirmation = assertionObjectFactory.createSubjectConfirmationType();
      subject.getContent().add(assertionObjectFactory.createSubjectConfirmation(subjectConfirmation));
      subjectConfirmation.setMethod(SamlConstants.CONFIRMATION_METHOD_BEARER);
      subjectConfirmation.setNameID(nameID);
View Full Code Here

   {
      LogoutRequestType logoutRequest = objectFactory.createLogoutRequestType();

      fillRequestAbstractTypeFields(logoutRequest);

      NameIDType nameID = assertionObjectFactory.createNameIDType();
      nameID.setValue(samlNameId.getValue());
      nameID.setFormat(samlNameId.getFormat());
      nameID.setNameQualifier(samlNameId.getQualifier());
      logoutRequest.setNameID(nameID);

      logoutRequest.getSessionIndex().add(sessionIndex);

      return logoutRequest;
View Full Code Here

   private void fillRequestAbstractTypeFields(RequestAbstractType request)
   {
      request.setID(dialogue.getId());
      request.setIssueInstant(SamlUtils.getXMLGregorianCalendarNow());

      NameIDType issuer = assertionObjectFactory.createNameIDType();
      issuer.setValue(samlEntityBean.get().getEntityId());
      request.setIssuer(issuer);

      request.setVersion(SamlConstants.VERSION_2_0);
   }
View Full Code Here

   private void fillStatusResponseFields(StatusResponseType response, String statusCode, String statusMessage)
   {
      response.setID(dialogue.getId());
      response.setIssueInstant(SamlUtils.getXMLGregorianCalendarNow());

      NameIDType issuer = assertionObjectFactory.createNameIDType();
      issuer.setValue(samlEntityBean.get().getEntityId());
      response.setIssuer(issuer);

      response.setVersion(SamlConstants.VERSION_2_0);
      response.setInResponseTo(samlDialogue.get().getExternalProviderMessageId());
View Full Code Here

TOP

Related Classes of org.jboss.identity.federation.saml.v2.assertion.NameIDType

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.