gpt4 book ai didi

org.openid4java.discovery.yadis.YadisResolver类的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 04:26:49 24 4
gpt4 key购买 nike

本文整理了Java中org.openid4java.discovery.yadis.YadisResolver类的一些代码示例,展示了YadisResolver类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YadisResolver类的具体详情如下:
包路径:org.openid4java.discovery.yadis.YadisResolver
类名称:YadisResolver

YadisResolver介绍

[英]Yadis discovery protocol implementation.

Yadis discovery protocol returns a Yadis Resource Descriptor (XRDS) document associated with a Yadis Identifier (YadisID)

YadisIDs can be any type of identifiers that are resolvable to a URL form, and in addition the URL form uses a HTTP or a HTTPS schema. Such an URL is defined by the Yadis speficification as a YadisURL. This functionality is implemented by the YadisURL helper class.

The discovery of the XRDS document is performed by the discover method on a YadisUrl.

Internal parameters used during the discovery process :

  • max redirects (default 10): maximum number of redirects to be followed for YadisURL
    [中]Yadis发现协议的实现。
    Yadis发现协议返回与Yadis标识符(YadisID)关联的Yadis资源描述符(XRDS)文档
    Yadisid可以是任何类型的标识符,可以解析为URL表单,此外,URL表单使用HTTP或HTTPS模式。Yadis规范将这样的URL定义为YadisURL。此功能由YadisURL helper类实现。
    XRDS文档的发现由YadisUrl上的discover方法执行。
    发现过程中使用的内部参数:
    *最大重定向(默认值10):YadisURL要遵循的最大重定向数

代码示例

代码示例来源:origin: org.openid4java/openid4java-nodeps

public YadisResult discover(String url, int maxRedirects, Set serviceTypes)
  throws DiscoveryException
{
 return discover(url, maxRedirects, _httpFetcher, serviceTypes);
}

代码示例来源:origin: org.openid4java/openid4java-nodeps

/**
 * Performs discovery on the Relying Party's realm and returns a list of
 * OpenID 2.0 DiscoveryInformation entries.
 * <p>
 * Static method / caller must provide a YadisResolver so that
 * the OP doesn't have to instantiate a Discovery object.
 *
 * @param realm         RP's realm.
 * @param yadisResolver The YadisResolver instance to be used for discovery.
 * @return              List of OpenID 2.0 DiscoveryInformation endpoints.
 */
public static List rpDiscovery(String realm, YadisResolver yadisResolver)
  throws DiscoveryException
{
  // don't follow redirects when doing RP discovery
  return yadisResolver.discoverRP(realm);
}

代码示例来源:origin: org.openid4java/openid4java-nodeps

/**
 * Constructs a ServerManager with default settings.
 */
public ServerManager() {
 this(new RealmVerifierFactory(new YadisResolver(new HttpFetcherFactory())));
}

代码示例来源:origin: org.wso2.org.openid4java/openid4java-nodeps

public YadisResult discover(String url, int maxRedirects, HttpFetcher httpFetcher, Set serviceTypes)
    throws DiscoveryException {
  YadisUrl yadisUrl = new YadisUrl(url);
  // try to retrieve the Yadis Descriptor URL with a HEAD call first
  YadisResult result = retrieveXrdsLocation(yadisUrl, false, maxRedirects, serviceTypes);
  // try GET 
  if (result.getXrdsLocation() == null) {
    result = retrieveXrdsLocation(yadisUrl, true, maxRedirects, serviceTypes);
  }
  if (result.getXrdsLocation() != null) {
    retrieveXrdsDocument(result, maxRedirects, serviceTypes);
  } else if (result.hasEndpoints()) {
    // report the yadis url as the xrds location
    result.setXrdsLocation(url, OpenIDException.YADIS_INVALID_URL);
  }
  _log.info("Yadis discovered " + result.getEndpointCount() + " endpoints from: " + url);
  return result;
}

代码示例来源:origin: org.openid4java/openid4java

String xrdsLocation = getHtmlMeta(resp.getBody());
if (xrdsLocation != null)

代码示例来源:origin: com.cloudbees/openid4java-shaded

/**
 * Constructs a ServerManager with default settings.
 */
public ServerManager() {
 this(new RealmVerifierFactory(new YadisResolver(new HttpFetcherFactory())));
}

代码示例来源:origin: jbufu/openid4java

public YadisResult discover(String url, int maxRedirects, HttpFetcher httpFetcher, Set serviceTypes)
  throws DiscoveryException
{
  YadisUrl yadisUrl = new YadisUrl(url);
  // try to retrieve the Yadis Descriptor URL with a HEAD call first
  YadisResult result = retrieveXrdsLocation(yadisUrl, false, maxRedirects, serviceTypes);
  // try GET 
  if (result.getXrdsLocation() == null)
    result = retrieveXrdsLocation(yadisUrl, true, maxRedirects, serviceTypes);
  if (result.getXrdsLocation() != null)
  {
    retrieveXrdsDocument(result, maxRedirects, serviceTypes);
  }
  else if (result.hasEndpoints())
  {
    // report the yadis url as the xrds location
    result.setXrdsLocation(url, OpenIDException.YADIS_INVALID_URL);
  }
  _log.info("Yadis discovered " + result.getEndpointCount() + " endpoints from: " + url);
  return result;
}

代码示例来源:origin: jbufu/openid4java

String xrdsLocation = getHtmlMeta(resp.getBody());
if (xrdsLocation != null)

代码示例来源:origin: org.wso2.org.openid4java/openid4java-nodeps

/**
 * Constructs a ServerManager with default settings.
 */
public ServerManager() {
  this(new RealmVerifierFactory(new YadisResolver(new HttpFetcherFactory())));
}

代码示例来源:origin: jbufu/openid4java

public YadisResult discover(String url, int maxRedirects, Set serviceTypes)
  throws DiscoveryException
{
 return discover(url, maxRedirects, _httpFetcher, serviceTypes);
}

代码示例来源:origin: com.cloudbees/openid4java-shaded

public YadisResult discover(String url, int maxRedirects, HttpFetcher httpFetcher, Set serviceTypes)
  throws DiscoveryException
{
  YadisUrl yadisUrl = new YadisUrl(url);
  // try to retrieve the Yadis Descriptor URL with a HEAD call first
  YadisResult result = retrieveXrdsLocation(yadisUrl, false, maxRedirects, serviceTypes);
  // try GET 
  if (result.getXrdsLocation() == null)
    result = retrieveXrdsLocation(yadisUrl, true, maxRedirects, serviceTypes);
  if (result.getXrdsLocation() != null)
  {
    retrieveXrdsDocument(result, maxRedirects, serviceTypes);
  }
  else if (result.hasEndpoints())
  {
    // report the yadis url as the xrds location
    result.setXrdsLocation(url, OpenIDException.YADIS_INVALID_URL);
  }
  _log.info("Yadis discovered " + result.getEndpointCount() + " endpoints from: " + url);
  return result;
}

代码示例来源:origin: org.wso2.org.openid4java/openid4java-nodeps

/**
 * Performs discovery on the Relying Party's realm and returns a list of
 * OpenID 2.0 DiscoveryInformation entries.
 * <p/>
 * Static method / caller must provide a YadisResolver so that
 * the OP doesn't have to instantiate a Discovery object.
 *
 * @param realm         RP's realm.
 * @param yadisResolver The YadisResolver instance to be used for discovery.
 * @return List of OpenID 2.0 DiscoveryInformation endpoints.
 */
public static List rpDiscovery(String realm, YadisResolver yadisResolver)
    throws DiscoveryException {
  // don't follow redirects when doing RP discovery
  return yadisResolver.discoverRP(realm);
}

代码示例来源:origin: org.wso2.org.openid4java/openid4java-nodeps

} else if (resp.getBody() != null) {
  String xrdsLocation = getHtmlMeta(resp.getBody());
  if (xrdsLocation != null) {
    result.setNormalizedUrl(resp.getFinalUri());

代码示例来源:origin: jbufu/openid4java

/**
 * Constructs a ServerManager with default settings.
 */
public ServerManager() {
 this(new RealmVerifierFactory(new YadisResolver(new HttpFetcherFactory())));
}

代码示例来源:origin: com.cloudbees/openid4java-shaded

public YadisResult discover(String url, int maxRedirects, Set serviceTypes)
  throws DiscoveryException
{
 return discover(url, maxRedirects, _httpFetcher, serviceTypes);
}

代码示例来源:origin: org.openid4java/openid4java-nodeps

public YadisResult discover(String url, int maxRedirects, HttpFetcher httpFetcher, Set serviceTypes)
  throws DiscoveryException
{
  YadisUrl yadisUrl = new YadisUrl(url);
  // try to retrieve the Yadis Descriptor URL with a HEAD call first
  YadisResult result = retrieveXrdsLocation(yadisUrl, false, maxRedirects, serviceTypes);
  // try GET 
  if (result.getXrdsLocation() == null)
    result = retrieveXrdsLocation(yadisUrl, true, maxRedirects, serviceTypes);
  if (result.getXrdsLocation() != null)
  {
    retrieveXrdsDocument(result, maxRedirects, serviceTypes);
  }
  else if (result.hasEndpoints())
  {
    // report the yadis url as the xrds location
    result.setXrdsLocation(url, OpenIDException.YADIS_INVALID_URL);
  }
  _log.info("Yadis discovered " + result.getEndpointCount() + " endpoints from: " + url);
  return result;
}

代码示例来源:origin: com.cloudbees/openid4java-shaded

/**
 * Performs discovery on the Relying Party's realm and returns a list of
 * OpenID 2.0 DiscoveryInformation entries.
 * <p>
 * Static method / caller must provide a YadisResolver so that
 * the OP doesn't have to instantiate a Discovery object.
 *
 * @param realm         RP's realm.
 * @param yadisResolver The YadisResolver instance to be used for discovery.
 * @return              List of OpenID 2.0 DiscoveryInformation endpoints.
 */
public static List rpDiscovery(String realm, YadisResolver yadisResolver)
  throws DiscoveryException
{
  // don't follow redirects when doing RP discovery
  return yadisResolver.discoverRP(realm);
}

代码示例来源:origin: org.openid4java/openid4java-nodeps

String xrdsLocation = getHtmlMeta(resp.getBody());
if (xrdsLocation != null)

代码示例来源:origin: org.openid4java/openid4java

/**
 * Constructs a ServerManager with default settings.
 */
public ServerManager() {
 this(new RealmVerifierFactory(new YadisResolver(new HttpFetcherFactory())));
}

代码示例来源:origin: org.openid4java/openid4java

public YadisResult discover(String url, int maxRedirects, Set serviceTypes)
  throws DiscoveryException
{
 return discover(url, maxRedirects, _httpFetcher, serviceTypes);
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com