Package org.openid4java.discovery

Examples of org.openid4java.discovery.DiscoveryException


   * Link-element based discovery.
   */
  private List<SecureDiscoveryInformation> tryLinkElementBasedDiscoveryForUser(
      UrlIdentifier claimedId) throws DiscoveryException {
    // TODO: implement this
    throw new DiscoveryException("link-element-based discovery is not " +
        "implemented yet");
  }
View Full Code Here


   * Link-header based discovery.
   */
  private List<SecureDiscoveryInformation> tryLinkHeaderBasedDiscoveryForUser(
      UrlIdentifier claimedId) throws DiscoveryException {
    // TODO: implement this
    throw new DiscoveryException("link-header-based discovery is not " +
        "implemented yet");
  }
View Full Code Here

    IdpIdentifier host = new IdpIdentifier(claimedId.getUrl().getHost());

    // find the <Service> element with type '.../describedby'
    Service service = getServiceForType(siteXrd.getXrd(), URI_TEMPLATE_TYPE);
    if (service == null) {
      throw new DiscoveryException("could not find service of type " +
          URI_TEMPLATE_TYPE + " in XRDS at location " +
          claimedId.getIdentifier());
    }

    // is there a NextAuthority? We only trust the next authority element
    // if the document is properly signed.
    String nextAuthority = checkSecurity(siteXrd, host, null)
        ? getTagValue(service, NEXT_AUTHORITY_TAG// might still be null
        : null;                                     // must be null if unsigned

    // find the <URITemplate> tag inside the <Service> element
    String uriTemplate = getTagValue(service, URI_TEMPLATE_TAG);
    if (uriTemplate == null) {
      throw new DiscoveryException("missing " + URI_TEMPLATE_TAG + " in " +
          "service specification in XRDS at location " +
          claimedId.getIdentifier());
    }

    // now, apply the mapping:
View Full Code Here

    boolean isSecure = checkSecurity(xrd, id, authority);

    List<Service> services = getServicesForType(xrd.getXrd(), version);

    if (services == null) {
      throw new DiscoveryException("could not find <Service> of type " +
          version + " in XRDS for " + xrd.getSource());
    }

    List<SecureDiscoveryInformation> result = new ArrayList<SecureDiscoveryInformation>(services.size());

    for (Service service : services) {
      try {
        if (version.equals(DiscoveryInformation.OPENID2)) {
          // look for LocalID and use claimedID, if given.
          result.add(createDiscoveryInfoForSignon(service, id, isSecure));
        } else if (version.equals(DiscoveryInformation.OPENID2_OP)) {
          // for site discovery, just return the URI
          result.add(createDiscoveryInfoForServer(service, isSecure));
        } else {
          throw new DiscoveryException("unkown OpenID version : " + version);
        }
      } catch (MalformedURLException e) {
        logger.log(Level.WARNING, "found malformed URL in discovery document " +
            "at " + xrd.getSource(), e);
        continue;
View Full Code Here

  private XrdRepresentations getXrd(URI uri) throws DiscoveryException {
    XrdRepresentations result;
    try {
      result = fetchXrd(uri);
    } catch (FetchException e) {
      throw new DiscoveryException("could not fetch XRDS from "
          + uri.toASCIIString(), e);
    }
    if (result == null) {
      throw new DiscoveryException("XRDS at " + uri.toASCIIString() + " did " +
          "not contain an XRD");
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of org.openid4java.discovery.DiscoveryException

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.