Examples of XRDS


Examples of org.jboss.seam.security.external.jaxb.xrds.XRDS

     */
    public void writeOpIdentifierXrds(Writer writer) {
        try {
            ObjectFactory objectFactory = new ObjectFactory();

            XRDS xrds = objectFactory.createXRDS();

            XRD xrd = objectFactory.createXRD();

            Type type = objectFactory.createType();
            type.setValue(DiscoveryInformation.OPENID2_OP);
            URIPriorityAppendPattern uri = objectFactory.createURIPriorityAppendPattern();
            uri.setValue(getServiceURL(OpenIdService.OPEN_ID_SERVICE));

            Service service = objectFactory.createService();
            service.getType().add(type);
            service.getURI().add(uri);

            xrd.getService().add(service);

            xrds.getOtherelement().add(xrd);

            Marshaller marshaller = jaxbContext.createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
            marshaller.marshal(xrds, writer);
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.xrds.XRDS

    public void writeClaimedIdentifierXrds(Writer writer, String opLocalIdentifier) {
        try {
            ObjectFactory objectFactory = new ObjectFactory();

            XRDS xrds = objectFactory.createXRDS();

            XRD xrd = objectFactory.createXRD();

            Type type = objectFactory.createType();
            type.setValue(DiscoveryInformation.OPENID2);
            URIPriorityAppendPattern uri = objectFactory.createURIPriorityAppendPattern();
            uri.setValue(getServiceURL(OpenIdService.OPEN_ID_SERVICE));

            Service service = objectFactory.createService();
            service.getType().add(type);
            service.getURI().add(uri);

            LocalID localId = new LocalID();
            localId.setValue(opLocalIdentifier);
            service.getLocalID().add(localId);

            xrd.getService().add(service);

            xrds.getOtherelement().add(xrd);

            Marshaller marshaller = jaxbContext.createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
            marshaller.marshal(xrds, writer);
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.xrds.XRDS

    public void writeRpXrds(Writer writer) {
        try {
            ObjectFactory objectFactory = new ObjectFactory();

            XRDS xrds = objectFactory.createXRDS();

            XRD xrd = objectFactory.createXRD();

            Type type = objectFactory.createType();
            type.setValue(DiscoveryInformation.OPENID2_RP);
            URIPriorityAppendPattern uri = objectFactory.createURIPriorityAppendPattern();
            uri.setValue(getServiceURL(OpenIdService.OPEN_ID_SERVICE));

            Service service = objectFactory.createService();
            service.getType().add(type);
            service.getURI().add(uri);

            xrd.getService().add(service);

            xrds.getOtherelement().add(xrd);

            Marshaller marshaller = jaxbContext.createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
            marshaller.marshal(xrds, writer);
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.xrds.XRDS

   {
      try
      {
         ObjectFactory objectFactory = new ObjectFactory();

         XRDS xrds = objectFactory.createXRDS();

         XRD xrd = objectFactory.createXRD();

         Type type = objectFactory.createType();
         type.setValue(DiscoveryInformation.OPENID2_OP);
         URIPriorityAppendPattern uri = objectFactory.createURIPriorityAppendPattern();
         uri.setValue(getServiceURL(OpenIdService.OPEN_ID_SERVICE));

         Service service = objectFactory.createService();
         service.getType().add(type);
         service.getURI().add(uri);

         xrd.getService().add(service);

         xrds.getOtherelement().add(xrd);

         Marshaller marshaller = jaxbContext.createMarshaller();
         marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
         marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
         marshaller.marshal(xrds, writer);
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.xrds.XRDS

   {
      try
      {
         ObjectFactory objectFactory = new ObjectFactory();

         XRDS xrds = objectFactory.createXRDS();

         XRD xrd = objectFactory.createXRD();

         Type type = objectFactory.createType();
         type.setValue(DiscoveryInformation.OPENID2);
         URIPriorityAppendPattern uri = objectFactory.createURIPriorityAppendPattern();
         uri.setValue(getServiceURL(OpenIdService.OPEN_ID_SERVICE));

         Service service = objectFactory.createService();
         service.getType().add(type);
         service.getURI().add(uri);

         LocalID localId = new LocalID();
         localId.setValue(opLocalIdentifier);
         service.getLocalID().add(localId);

         xrd.getService().add(service);

         xrds.getOtherelement().add(xrd);

         Marshaller marshaller = jaxbContext.createMarshaller();
         marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
         marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
         marshaller.marshal(xrds, writer);
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.xrds.XRDS

   {
      try
      {
         ObjectFactory objectFactory = new ObjectFactory();

         XRDS xrds = objectFactory.createXRDS();

         XRD xrd = objectFactory.createXRD();

         Type type = objectFactory.createType();
         type.setValue(DiscoveryInformation.OPENID2_RP);
         URIPriorityAppendPattern uri = objectFactory.createURIPriorityAppendPattern();
         uri.setValue(getServiceURL(OpenIdService.OPEN_ID_SERVICE));

         Service service = objectFactory.createService();
         service.getType().add(type);
         service.getURI().add(uri);

         xrd.getService().add(service);

         xrds.getOtherelement().add(xrd);

         Marshaller marshaller = jaxbContext.createMarshaller();
         marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
         marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
         marshaller.marshal(xrds, writer);
View Full Code Here

Examples of org.openxri.xml.XRDS

   */
  private XrdRepresentations fetchXrd(URI uri) throws FetchException {

    FetchRequest request = FetchRequest.createGetRequest(uri);

    XRDS xrds;
    byte[] documentBytes;
    String signature;

    try {
      FetchResponse response = httpFetcher.fetch(request);

      documentBytes = response.getContentAsBytes();
      signature = response.getFirstHeader("Signature"); // could be null

      Document document =
          XmlUtil.getDocument(new ByteArrayInputStream(documentBytes));

      xrds = new XRDS(document.getDocumentElement(), false);

    } catch (ParserConfigurationException e) {
      throw new FetchException(e);
    } catch (SAXException e) {
      throw new FetchException(e);
    } catch (IOException e) {
      throw new FetchException(e);
    } catch (URISyntaxException e) {
      throw new FetchException(e);
    } catch (ParseException e) {
      throw new FetchException(e);
    }

    return new XrdRepresentations(xrds.getFinalXRD(), uri.toASCIIString(),
        documentBytes, signature);
  }
View Full Code Here

Examples of org.openxri.xml.XRDS

 
 
  protected XRDS processRefs(XRD parent, ResolverFlags flags, ResolverState state)
    throws PartialResolutionException
  {
    XRDS xrdsOut = new XRDS();
    //// get all the Refs in the parent XRD
    List refs = parent.getPrioritizedRefs();
    Iterator it = refs.iterator();
   
    //// try each one in turn
    while (it.hasNext()) {
      Ref ref = (Ref)it.next();

      checkMaxRefs(xrdsOut, ref.getValue(), state);

      XRI refXRI;
      try {
        refXRI = parseAbsoluteQXRIOrError(ref.getValue());
      }
      catch (PartialResolutionException e) {
        xrdsOut.add(e.getPartialXRDS());
        continue;
      }
     
      // record that we are following a ref
      state.pushFollowingRef(refXRI);
     
      try {
        XRDS tmpXRDS = resolveAuthority(refXRI, flags, state);
        xrdsOut.add(tmpXRDS);
        break;
      }
      catch (PartialResolutionException e) {
        xrdsOut.add(e.getPartialXRDS());
View Full Code Here

Examples of org.openxri.xml.XRDS

          // construct URI
          String constructedURI = constructURI(uri, r.getAppend(), qxri);
          uri = new URI(constructedURI);
        }
      } catch (URISyntaxException e) {
        XRDS tmpXRDS = new XRDS();
        XRD err = createErrorXRD(r.getValue(), Status.INVALID_REDIRECT, "Invalid Redirect URI");
        tmpXRDS.add(err);
        xrdsOut.add(tmpXRDS);
        continue;
      }
     
      try {
        XRDS tmpXRDS = fetchRedirectXRDS(uri, parent, qxri, flags, state);
        xrdsOut.add(tmpXRDS);
       
        XRD finalXRD = tmpXRDS.getFinalXRD();
        tmpXRDS = new XRDS();
        List services = selectServiceFromXRD(tmpXRDS, finalXRD, qxri, sepType, sepMediaType, flags, state);
        xrdsOut.addAll(tmpXRDS);
        return services; // we're done!
      } catch (XRIResolutionException e) {
        XRDS tmpXRDS = new XRDS();
        XRD err = createErrorXRD(uri.toString(), Status.REDIRECT_ERROR, "Error fetching XRDS: " + e.getMessage());
        tmpXRDS.add(err);
        xrdsOut.add(tmpXRDS);
       
        // fall through to continue to the next
      }
    }
View Full Code Here

Examples of org.openxri.xml.XRDS

     
      // record that we are following a ref
      state.pushFollowingRef(refXRI);
     
      try {
        XRDS tmpXRDS = resolveSEPToXRDS(refXRI, sepType, sepMediaType, flags, state);
        xrdsOut.add(tmpXRDS);
        return tmpXRDS.getFinalXRD().getSelectedServices().getList();
      }
      catch (PartialResolutionException e) {
        xrdsOut.add(e.getPartialXRDS());
        // fall through to continue to the next
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.