当前位置: 首页>>代码示例>>Java>>正文


Java ConsumerManager类代码示例

本文整理汇总了Java中org.openid4java.consumer.ConsumerManager的典型用法代码示例。如果您正苦于以下问题:Java ConsumerManager类的具体用法?Java ConsumerManager怎么用?Java ConsumerManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ConsumerManager类属于org.openid4java.consumer包,在下文中一共展示了ConsumerManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reconnectToMxID

import org.openid4java.consumer.ConsumerManager; //导入依赖的package包/类
private void reconnectToMxID() {
	LOG.info("Starting OpenId handler ... OpenIDReturnURL = " + OPENID_RETURN_URL + "; OpenIdProvider: " + OPENID_PROVIDER);
	try {

		manager = new ConsumerManager();
		manager.setAssociations(new InMemoryConsumerAssociationStore());
		manager.setNonceVerifier(new InMemoryNonceVerifier(5000));
		manager.setMinAssocSessEnc(AssociationSessionType.DH_SHA256);
		manager.getRealmVerifier().setEnforceRpId(true);

		discoveries = manager.discover(OPENID_PROVIDER);
		discovered = manager.associate(discoveries);

		started = true;
		LOG.info("Starting OpenId handler ... DONE");

	} catch (DiscoveryException e) {
		LOG.error("Failed to discover OpenId service: " + e.getMessage(), e);
	}
}
 
开发者ID:mendix,项目名称:IBM-Watson-Connector-Suite,代码行数:21,代码来源:OpenIDHandler.java

示例2: testEmptyUri

import org.openid4java.consumer.ConsumerManager; //导入依赖的package包/类
public void testEmptyUri() throws Exception
{
    // empty string is a valid java.net.URI...

    YadisResult yadis = _resolver.discover("http://localhost:" + _servletPort + "/?headers=simplexrds&xrds=malformedxrds6",
        10, Collections.singleton("http://example.com/"));

    assertTrue("XRDS with an empty URI is valid; Yadis should have succeeded",
               yadis.getEndpoints().size() > 0);

    // also run through Discovery.extractDiscoveryInformation()
    ConsumerManager manager = new ConsumerManager();

    List results = manager.discover("http://localhost:" +
        _servletPort + "/?headers=simplexrds&xrds=malformedxrds6");

    assertEquals("No discovery information should have been returned for an empty URI",
                 0, results.size());

}
 
开发者ID:jbufu,项目名称:openid4java,代码行数:21,代码来源:YadisResolverTest.java

示例3: init

import org.openid4java.consumer.ConsumerManager; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public void init(ServletConfig config) throws ServletException {
	super.init(config);

	context = config.getServletContext();

	LOG.debug("context: " + context);

	// --- Forward proxy setup (only if needed) ---
	ProxyProperties proxyProps = getProxyProperties(config);
	if (proxyProps != null) {
		LOG.debug("ProxyProperties: " + proxyProps);
		HttpClientFactory.setProxyProperties(proxyProps);
	}

	this.manager = new ConsumerManager();
	manager.setAssociations(new InMemoryConsumerAssociationStore());
	manager.setNonceVerifier(new InMemoryNonceVerifier(5000));
	manager.setMinAssocSessEnc(AssociationSessionType.DH_SHA256);
}
 
开发者ID:jbufu,项目名称:openid4java,代码行数:23,代码来源:ConsumerServlet.java

示例4: reconnectToMxID

import org.openid4java.consumer.ConsumerManager; //导入依赖的package包/类
private void reconnectToMxID() {
	log.info("Starting OpenId handler ... OpenIDReturnURL = " + OpenIDReturnURL + "; OpenIdProvider: " + OPENID_PROVIDER);
	try {

		manager = new ConsumerManager();
		manager.setAssociations(new InMemoryConsumerAssociationStore());
		manager.setNonceVerifier(new InMemoryNonceVerifier(5000));
		manager.setMinAssocSessEnc(AssociationSessionType.DH_SHA256);
		manager.getRealmVerifier().setEnforceRpId(true);

		discoveries = manager.discover(OPENID_PROVIDER);
		discovered = manager.associate(discoveries);

		started = true;
		log.info("Starting OpenId handler ... DONE");

	} catch (Exception e) {
		log.error("Failed to discover OpenId service: " + e.getMessage(), e);
	}
}
 
开发者ID:mendix,项目名称:EmailModuleWithTemplates,代码行数:21,代码来源:OpenIDHandler.java

示例5: init

import org.openid4java.consumer.ConsumerManager; //导入依赖的package包/类
public void init(FilterConfig config) throws ServletException {
    super.init(config);
    try 
    {
        this.manager = new ConsumerManager();
    } catch (ConsumerException ex) {
        throw new ServletException(ex);
    }
    manager.setAssociations(new InMemoryConsumerAssociationStore());
    manager.setNonceVerifier(new InMemoryNonceVerifier(5000));
    manager.setMinAssocSessEnc(AssociationSessionType.DH_SHA256);
    manager.setImmediateAuth(true);
}
 
开发者ID:resteasy,项目名称:resteasy-examples,代码行数:14,代码来源:OpenIdFilter.java

示例6: OpenIdAuthenticator

import org.openid4java.consumer.ConsumerManager; //导入依赖的package包/类
/**
 * Creates a new instance of OpenIdAuthenticator.
 */
public OpenIdAuthenticator()
{
    try
    {
        m_oManager = new ConsumerManager();
    } 
    catch (ConsumerException e)
    {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
 
开发者ID:glycoinfo,项目名称:eurocarbdb,代码行数:16,代码来源:OpenIdAuthenticator.java

示例7: OpenIdServiceImpl

import org.openid4java.consumer.ConsumerManager; //导入依赖的package包/类
@Inject
OpenIdServiceImpl(
    DynamicItem<WebSession> cf,
    Provider<IdentifiedUser> iu,
    CanonicalWebUrl up,
    @GerritServerConfig Config config,
    AuthConfig ac,
    AccountManager am,
    ProxyProperties proxyProperties) {

  if (proxyProperties.getProxyUrl() != null) {
    final org.openid4java.util.ProxyProperties proxy = new org.openid4java.util.ProxyProperties();
    URL url = proxyProperties.getProxyUrl();
    proxy.setProxyHostName(url.getHost());
    proxy.setProxyPort(url.getPort());
    proxy.setUserName(proxyProperties.getUsername());
    proxy.setPassword(proxyProperties.getPassword());
    HttpClientFactory.setProxyProperties(proxy);
  }

  webSession = cf;
  identifiedUser = iu;
  urlProvider = up;
  accountManager = am;
  manager = new ConsumerManager();
  allowedOpenIDs = ac.getAllowedOpenIDs();
  openIdDomains = ac.getOpenIdDomains();
  papeMaxAuthAge =
      (int)
          ConfigUtil.getTimeUnit(
              config, //
              "auth",
              null,
              "maxOpenIdSessionAge",
              -1,
              TimeUnit.SECONDS);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:38,代码来源:OpenIdServiceImpl.java

示例8: prepareAuthenticationUrl

import org.openid4java.consumer.ConsumerManager; //导入依赖的package包/类
/**
 * Prepares open ID authentication URL.
 *
 * @param openIdIdentifier the open ID identifier to authenticate
 * @param siteUrl the site URL
 * @param returnViewName the return view name
 * @return the authentication URL
 * @throws DiscoveryException if discovery exception occurs.
 * @throws MessageException if message exception occurs.
 * @throws ConsumerException if consume exception occurs.
 */
public static String prepareAuthenticationUrl(final String openIdIdentifier, final String siteUrl
        , final String returnViewName)
        throws DiscoveryException, MessageException, ConsumerException {
    if (UI.getCurrent().getSession().getAttribute(ConsumerManager.class) == null) {
        UI.getCurrent().getSession().setAttribute(ConsumerManager.class, new ConsumerManager());
    }
    final ConsumerManager manager = UI.getCurrent().getSession().getAttribute(ConsumerManager.class);
    final String returnURL = siteUrl + returnViewName;
    final List discoveries = manager.discover(openIdIdentifier);
    final DiscoveryInformation discovered = manager.associate(discoveries);
    UI.getCurrent().getSession().setAttribute(DiscoveryInformation.class, discovered);
    final AuthRequest authReq = manager.authenticate(discovered, returnURL);
    return authReq.getDestinationUrl(true);
}
 
开发者ID:bubblecloud,项目名称:ilves,代码行数:26,代码来源:OpenIdUtil.java

示例9: getVerificationResult

import org.openid4java.consumer.ConsumerManager; //导入依赖的package包/类
/**
 * Gets verification result based on session and request parameters. This should be called when
 * processing the OpenId return request.
 * @param siteUrl the site URL
 * @param returnViewName the return view name
 *
 * @return the verification result
 * @throws DiscoveryException if discovery exception occurs.
 * @throws MessageException if message exception occurs.
 * @throws AssociationException if association exception occurs.
 */
public static VerificationResult getVerificationResult(final String siteUrl
        , final String returnViewName) throws MessageException, DiscoveryException,
        AssociationException {
    final ConsumerManager consumerManager = UI.getCurrent().getSession().getAttribute(ConsumerManager.class);
    final DiscoveryInformation discovered = UI.getCurrent().getSession().getAttribute(
            DiscoveryInformation.class);
    UI.getCurrent().getSession().setAttribute(ConsumerManager.class, null);
    UI.getCurrent().getSession().setAttribute(DiscoveryInformation.class, null);

    final HttpServletRequest request = ((VaadinServletRequest) VaadinService.getCurrentRequest())
            .getHttpServletRequest();

    final StringBuffer urlBuilder = new StringBuffer(siteUrl + returnViewName);
    final String queryString = request.getQueryString();
    if (queryString != null) {
        urlBuilder.append('?');
        urlBuilder.append(queryString);
    }
    final String requestUrl = urlBuilder.toString();

    final ParameterList openidResp = new ParameterList(request.getParameterMap());

    // verify the response
    return consumerManager.verify(requestUrl,
            openidResp, discovered);
}
 
开发者ID:bubblecloud,项目名称:ilves,代码行数:38,代码来源:OpenIdUtil.java

示例10: setAccessGrant

import org.openid4java.consumer.ConsumerManager; //导入依赖的package包/类
@Override
public void setAccessGrant(final AccessGrant accessGrant)
		throws AccessTokenExpireException {
	try {
		manager = new ConsumerManager();
	} catch (Exception e) {
		throw new RuntimeException(e);
	}
	discovered = null;
	this.accessGrant = accessGrant;
}
 
开发者ID:3pillarlabs,项目名称:socialauth,代码行数:12,代码来源:OpenIdImpl.java

示例11: internalInit

import org.openid4java.consumer.ConsumerManager; //导入依赖的package包/类
@Override
protected void internalInit(final WebContext context) {
    CommonHelper.assertNotBlank("callbackUrl", this.callbackUrl);
    this.consumerManager = new ConsumerManager();
}
 
开发者ID:yaochi,项目名称:pac4j-plus,代码行数:6,代码来源:BaseOpenIdClient.java

示例12: getConsumerManager

import org.openid4java.consumer.ConsumerManager; //导入依赖的package包/类
public ConsumerManager getConsumerManager() {
    return consumerManager;
}
 
开发者ID:wso2-extensions,项目名称:identity-agent-sso,代码行数:4,代码来源:SSOAgentDataHolder.java

示例13: setConsumerManager

import org.openid4java.consumer.ConsumerManager; //导入依赖的package包/类
public void setConsumerManager(ConsumerManager consumerManager) {
    this.consumerManager = consumerManager;
}
 
开发者ID:wso2-extensions,项目名称:identity-agent-sso,代码行数:4,代码来源:SSOAgentDataHolder.java

示例14: setConsumerManager

import org.openid4java.consumer.ConsumerManager; //导入依赖的package包/类
public void setConsumerManager(ConsumerManager consumerManager)
{
    this._consumerManager = consumerManager;
}
 
开发者ID:jbufu,项目名称:openid4java,代码行数:5,代码来源:IndexController.java

示例15: PrepareRequestAttributesFilter

import org.openid4java.consumer.ConsumerManager; //导入依赖的package包/类
@Inject
public PrepareRequestAttributesFilter(ConsumerManager consumerManager) {
  this.consumerManager = consumerManager;
}
 
开发者ID:jbufu,项目名称:openid4java,代码行数:5,代码来源:PrepareRequestAttributesFilter.java


注:本文中的org.openid4java.consumer.ConsumerManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。