Examples of DiscoveryException


Examples of org.openid4java.discovery.DiscoveryException

      Discovery discovery = consumerManager.getDiscovery();
      @SuppressWarnings("unchecked")
      List<DiscoveryInformation> discoveries = discovery.discover(openId);

      if (discoveries == null || discoveries.size() == 0) {
        throw new DiscoveryException("discovery on " + openId.getIdentifier() +
            " failed.");
      }

      discovered = consumerManager.associate(discoveries);
    }
View Full Code Here

Examples of org.openid4java.discovery.DiscoveryException

    // get host-meta for that host
    HostMeta hostMeta;
    try {
      hostMeta = hostMetaFetcher.getHostMeta(host);
    } catch (HostMetaException e) {
      throw new DiscoveryException("could not get host-meta for " + host, e);
    }

    // Find XRD that host-meta is pointing to. In the case of site-discovery,
    // this will point to the site's XRD.
    URI xrdUri = xrdLocationSelector.findSiteXrdUriForOp(hostMeta,
View Full Code Here

Examples of org.openid4java.discovery.DiscoveryException

    // get host-meta for that host
    HostMeta hostMeta;
    try {
      hostMeta = hostMetaFetcher.getHostMeta(host);
    } catch (HostMetaException e) {
      throw new DiscoveryException("could not get host-meta for " + host, e);
    }

    // First, let's check whether there are link-patterns in the host-meta that
    // point directly to the user's XRD(S).
    URI xrdUri = xrdLocationSelector.findUserXrdUriForOp(hostMeta,
View Full Code Here

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

Examples of org.openid4java.discovery.DiscoveryException

   * 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

Examples of org.openid4java.discovery.DiscoveryException

    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

Examples of org.openid4java.discovery.DiscoveryException

    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 =
        Lists.newArrayListWithCapacity(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

Examples of org.openid4java.discovery.DiscoveryException

  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

Examples of org.wso2.carbon.discovery.DiscoveryException

    public OMNode findEndpoint(String uuid, String protocol) throws Exception {
        ConfigurationContext cfgCtx = ConfigHolder.getInstance().getClientConfigurationContext();
        String proxyURL = properties.getProperty(DISCOVERY_PROXY_URL);
        if (proxyURL == null) {
            throw new DiscoveryException("The discovery proxy URL is not specified");
        }
        DiscoveryClient client = new DiscoveryClient(cfgCtx, proxyURL);
        TargetService service = client.resolve(uuid);
        client.cleanup();
        return getEndpointFromService(service, protocol);
View Full Code Here

Examples of org.wso2.carbon.discovery.DiscoveryException

    public DiscoveryClient(ConfigurationContext cfgCtx, String proxyURL) throws DiscoveryException {
        try {
            serviceClient = new ServiceClient(cfgCtx, null);
            serviceClient.setTargetEPR(new EndpointReference(proxyURL));
        } catch (AxisFault axisFault) {
            throw new DiscoveryException("Error while initializing the WS-Discovery client", axisFault);
        }
    }
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.