Package org.openid4java.consumer

Examples of org.openid4java.consumer.ConsumerManager


    }
  }

  private ConsumerManager getConsumerManager() {
    Application app = Session.get().getApplication();
    ConsumerManager consumerManager = app.getMetaData(CONSUMER_MANAGER_KEY);
    if (consumerManager == null) {
      // double checked locking
      synchronized (CONSUMER_MANAGER_KEY) {
        consumerManager = app.getMetaData(CONSUMER_MANAGER_KEY);
        if (consumerManager == null) {
          consumerManager = new ConsumerManager();
          consumerManager.setAssociations(new InMemoryConsumerAssociationStore());
          consumerManager.setNonceVerifier(new InMemoryNonceVerifier(10000));
          app.setMetaData(CONSUMER_MANAGER_KEY, consumerManager);
        }
      }
    }
    return consumerManager;
View Full Code Here


    WicketUtils.performTemporaryRedirect(authRequest.getDestinationUrl(true));
  }

  private AuthRequest createOpenIdAuthRequest() {
    try {
      ConsumerManager consumerManager = OpenIdSession.get().getConsumerManager();

      AuthRequest auth = consumerManager.authenticate(discoveryInformation, OpenIdSession.get()
          .getOpenIdReturnUrl());

      if (discoveryInformation.getTypes().contains(AxMessage.OPENID_NS_AX)) {
        FetchRequest fetch = FetchRequest.createFetchRequest();
        fetch.addAttribute("email", "http://axschema.org/contact/email", true);
View Full Code Here

    }
  }

  private DiscoveryInformation performDiscovery(String openId) {
    try {
      ConsumerManager consumerManager = getConsumerManager();
      List<?> discoveries = consumerManager.discover(openId);
      return consumerManager.associate(discoveries);
    } catch (DiscoveryException e) {
      throw new WicketRuntimeException("discovery failed", e);
    }
  }
View Full Code Here

     */
    private ConsumerManager getConsumerManager() {
        if(this.consumerManager != null) {
            return this.consumerManager;
        }
        return new ConsumerManager();
    }
View Full Code Here

  private Profile userProfile;
  private boolean providerState = false;

  public OpenIdImpl(final Properties props) throws ConsumerException,
      Exception {
    manager = new ConsumerManager();
    discovered = null;
    this.id = props.getProperty("id");
  }
View Full Code Here

    this.id = props.getProperty("id");
  }

  public OpenIdImpl(final OAuthConfig config) throws ConsumerException,
      Exception {
    manager = new ConsumerManager();
    this.id = config.getId();
    discovered = null;
  }
View Full Code Here

  @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;
View Full Code Here

    }
  }

  private ConsumerManager getConsumerManager() {
    Application app = Session.get().getApplication();
    ConsumerManager consumerManager = app.getMetaData(CONSUMER_MANAGER_KEY);
    if (consumerManager == null) {
      // double checked locking
      synchronized (CONSUMER_MANAGER_KEY) {
        try {
          consumerManager = app.getMetaData(CONSUMER_MANAGER_KEY);
          if (consumerManager == null) {
            consumerManager = new ConsumerManager();
            consumerManager.setAssociations(new InMemoryConsumerAssociationStore());
            consumerManager.setNonceVerifier(new InMemoryNonceVerifier(10000));
            app.setMetaData(CONSUMER_MANAGER_KEY, consumerManager);
          }
        } catch (ConsumerException e) {
          throw new RuntimeException("failed to create ConsumerManager", e);
        }
View Full Code Here

    WicketUtils.getResponse().redirect(authRequest.getDestinationUrl(true));
  }

  private AuthRequest createOpenIdAuthRequest() {
    try {
      ConsumerManager consumerManager = OpenIdSession.get().getConsumerManager();

      AuthRequest auth = consumerManager.authenticate(discoveryInformation, OpenIdSession.get()
          .getOpenIdReturnUrl());

      if (discoveryInformation.getTypes().contains(AxMessage.OPENID_NS_AX)) {
        FetchRequest fetch = FetchRequest.createFetchRequest();
        fetch.addAttribute("email", "http://axschema.org/contact/email", true);
View Full Code Here

    }
  }

  private DiscoveryInformation performDiscovery(String openId) {
    try {
      ConsumerManager consumerManager = getConsumerManager();
      List<?> discoveries = consumerManager.discover(openId);
      return consumerManager.associate(discoveries);
    } catch (DiscoveryException e) {
      throw new WicketRuntimeException("discovery failed", e);
    }
  }
View Full Code Here

TOP

Related Classes of org.openid4java.consumer.ConsumerManager

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.