public List discover(String identifier) throws DiscoveryException { return discover(parseIdentifier(identifier, true)); // remove fragment }
List endpoints = Discovery.rpDiscovery(realm, _yadisResolver); DiscoveryInformation endpoint; String endpointUrl;
private ConsumerManager getConsumerManagerInstance() throws SSOAgentException { HttpFetcherFactory httpFetcherFactory = null; try { httpFetcherFactory = new HttpFetcherFactory(SSLContext.getDefault(), null); } catch (NoSuchAlgorithmException e) { throw new SSOAgentException("Error while getting default SSL Context", e); } return new ConsumerManager( new RealmVerifierFactory(new YadisResolver(httpFetcherFactory)), new Discovery(), httpFetcherFactory); }
HtmlResolver htmlResolver = new HtmlResolver( httpFetcherFactory); XriResolver xriResolver = Discovery.getXriResolver(); Discovery discovery = new Discovery(htmlResolver, yadisResolver, xriResolver); this.consumerManager = new ConsumerManager(realmFactory,
/** * Does discovery on an identifier. It delegates the call to its * discovery manager. * * @return A List of {@link DiscoveryInformation} objects. * The list could be empty if no discovery information can * be retrieved. * @throws DiscoveryException if the discovery process runs into errors. */ public List discover(String identifier) throws DiscoveryException { return _discovery.discover(identifier); }
public Identifier parseIdentifier(String identifier, boolean removeFragment) throws DiscoveryException { try { // strip the xri:// prefix if it exists if (identifier.toLowerCase().startsWith("xri://")) { if (DEBUG) _log.debug("Dropping xri:// prefix from identifier: " + identifier); identifier = identifier.substring(6); } if (URL_PATTERN.matcher(identifier).find()) { if (DEBUG) _log.debug("Creating URL identifier for: " + identifier); return new UrlIdentifier(identifier, removeFragment); } else if (XRI_PATTERN.matcher(identifier).find()) { if (DEBUG) _log.debug("Creating XRI identifier for: " + identifier); return _xriResolver.parseIdentifier(identifier); } else { if (DEBUG) _log.debug("Creating URL identifier (http:// prepended) for: " + identifier); return new UrlIdentifier("http://" + identifier, removeFragment); }
public Discovery() { this( new HtmlResolver(new HttpFetcherFactory()), new YadisResolver(new HttpFetcherFactory()), getXriResolver()); }
private ConsumerManager getConsumerManagerInstance() throws SSOAgentException { HttpFetcherFactory httpFetcherFactory = null; try { httpFetcherFactory = new HttpFetcherFactory(SSLContext.getDefault(), null); } catch (NoSuchAlgorithmException e) { throw new SSOAgentException("Error while getting default SSL Context", e); } return new ConsumerManager( new RealmVerifierFactory(new YadisResolver(httpFetcherFactory)), new Discovery(), httpFetcherFactory); }
/** * Does discovery on an identifier. It delegates the call to its * discovery manager. * * @return A List of {@link DiscoveryInformation} objects. * The list could be empty if no discovery information can * be retrieved. * * @throws DiscoveryException if the discovery process runs into errors. */ public List discover(String identifier) throws DiscoveryException { return _discovery.discover(identifier); }
public Identifier parseIdentifier(String identifier, boolean removeFragment) throws DiscoveryException { try { // strip the xri:// prefix if it exists if (identifier.toLowerCase().startsWith("xri://")) { if (DEBUG) { _log.debug("Dropping xri:// prefix from identifier: " + identifier); } identifier = identifier.substring(6); } if (URL_PATTERN.matcher(identifier).find()) { if (DEBUG) { _log.debug("Creating URL identifier for: " + identifier); } return new UrlIdentifier(identifier, removeFragment); } else if (XRI_PATTERN.matcher(identifier).find()) { if (DEBUG) { _log.debug("Creating XRI identifier for: " + identifier); } return _xriResolver.parseIdentifier(identifier); } else { if (DEBUG) { _log.debug("Creating URL identifier (http:// prepended) for: " + identifier); } return new UrlIdentifier("http://" + identifier, removeFragment); }
public Discovery() { this( new HtmlResolver(new HttpFetcherFactory()), new YadisResolver(new HttpFetcherFactory()), getXriResolver()); }
public List discover(Identifier identifier) throws DiscoveryException { List result; if (identifier instanceof XriIdentifier) { _log.info("Starting discovery on XRI identifier: " + identifier); result = _xriResolver.discover((XriIdentifier) identifier); } else if (identifier instanceof UrlIdentifier) { _log.info("Starting discovery on URL identifier: " + identifier); UrlIdentifier urlId = (UrlIdentifier) identifier; result = _yadisResolver.discover(urlId.getIdentifier()); // fall-back to HTML discovery if (result == null || result.size() == 0) { _log.info("No OpenID service endpoints discovered through Yadis;" + " attempting HTML discovery..."); result = _htmlResolver.discoverHtml(urlId); } } else { throw new DiscoveryException( "Unknown identifier type: " + identifier.toString()); } _log.info("Discovered " + result.size() + " OpenID endpoints."); return result; }
/** * Instantiates a ConsumerManager with default settings. */ public ConsumerManager() { this( new RealmVerifierFactory(new YadisResolver(new HttpFetcherFactory())), new Discovery(), // uses HttpCache internally new HttpFetcherFactory()); }
/** * Does discovery on an identifier. It delegates the call to its * discovery manager. * * @return A List of {@link DiscoveryInformation} objects. * The list could be empty if no discovery information can * be retrieved. * * @throws DiscoveryException if the discovery process runs into errors. */ public List discover(String identifier) throws DiscoveryException { return _discovery.discover(identifier); }
public Identifier parseIdentifier(String identifier, boolean removeFragment) throws DiscoveryException { try { // strip the xri:// prefix if it exists if (identifier.toLowerCase().startsWith("xri://")) { if (DEBUG) _log.debug("Dropping xri:// prefix from identifier: " + identifier); identifier = identifier.substring(6); } if (URL_PATTERN.matcher(identifier).find()) { if (DEBUG) _log.debug("Creating URL identifier for: " + identifier); return new UrlIdentifier(identifier, removeFragment); } else if (XRI_PATTERN.matcher(identifier).find()) { if (DEBUG) _log.debug("Creating XRI identifier for: " + identifier); return _xriResolver.parseIdentifier(identifier); } else { if (DEBUG) _log.debug("Creating URL identifier (http:// prepended) for: " + identifier); return new UrlIdentifier("http://" + identifier, removeFragment); }
public Discovery() { this( new HtmlResolver(new HttpFetcherFactory()), new YadisResolver(new HttpFetcherFactory()), getXriResolver()); }
realm = realm.replaceFirst("\\*\\.", "www."); List endpoints = Discovery.rpDiscovery(realm, _yadisResolver); DiscoveryInformation endpoint; String endpointUrl;
public List discover(Identifier identifier) throws DiscoveryException { List result; if (identifier instanceof XriIdentifier) { _log.info("Starting discovery on XRI identifier: " + identifier); result = _xriResolver.discover((XriIdentifier) identifier); } else if (identifier instanceof UrlIdentifier) { _log.info("Starting discovery on URL identifier: " + identifier); UrlIdentifier urlId = (UrlIdentifier) identifier; result = _yadisResolver.discover(urlId.getIdentifier()); // fall-back to HTML discovery if (result == null || result.size() == 0) { _log.info("No OpenID service endpoints discovered through Yadis;" + " attempting HTML discovery..."); result = _htmlResolver.discoverHtml(urlId); } } else { throw new DiscoveryException( "Unknown identifier type: " + identifier.toString()); } _log.info("Discovered " + result.size() + " OpenID endpoints."); return result; }
/** * Instantiates a ConsumerManager with default settings. */ public ConsumerManager() { this( new RealmVerifierFactory(new YadisResolver(new HttpFetcherFactory())), new Discovery(), // uses HttpCache internally new HttpFetcherFactory()); }
/** * Does discovery on an identifier. It delegates the call to its * discovery manager. * * @return A List of {@link DiscoveryInformation} objects. * The list could be empty if no discovery information can * be retrieved. * * @throws DiscoveryException if the discovery process runs into errors. */ public List discover(String identifier) throws DiscoveryException { return _discovery.discover(identifier); }