Package org.springframework.social

Examples of org.springframework.social.UserIdSource


    performFilterForPostRequest("/connect/google/", "google");
  }

  private void performFilterForPostRequest(String servletPath, String providerId) throws IOException, ServletException {
    UsersConnectionRepository uconnRepo = mock(UsersConnectionRepository.class);
    UserIdSource userIdSource = new UserIdSource() {
      public String getUserId() {
        return "habuma";
      }
    };
View Full Code Here


  @ConditionalOnMissingClass(name = "org.springframework.security.core.context.SecurityContextHolder")
  protected static class AnonymousUserIdSourceConfig extends SocialConfigurerAdapter {

    @Override
    public UserIdSource getUserIdSource() {
      return new UserIdSource() {
        @Override
        public String getUserId() {
          return "anonymous";
        }
      };
View Full Code Here

    }
  }
 
  @Bean
  public UserIdSource userIdSource() {
    UserIdSource userIdSource = null;
    for (SocialConfigurer socialConfigurer : socialConfigurers) {
      UserIdSource userIdSourceCandidate = socialConfigurer.getUserIdSource();
      if (userIdSourceCandidate != null) {
        userIdSource = userIdSourceCandidate;
        break;
      }
    }
View Full Code Here

    repository.setConnectionSignUp(new SimpleConnectionSignUp());
    return repository;
  }
 
  public UserIdSource getUserIdSource() {
    return new UserIdSource() {
      @Override
      public String getUserId() {
        return SecurityContext.getCurrentUser().getId();
      }
    };
View Full Code Here

    repository.setConnectionSignUp(new SimpleConnectionSignUp());
    return repository;
  }
 
  public UserIdSource getUserIdSource() {
    return new UserIdSource() {
      @Override
      public String getUserId() {
        return SecurityContext.getCurrentUser().getId();
      }
    };
View Full Code Here

    cfConfig.addConnectionFactory(new LinkedInConnectionFactory(env.getProperty("linkedin.appKey"), env.getProperty("linkedin.appSecret")));
  }
 
  @Override
  public UserIdSource getUserIdSource() {
    return new UserIdSource() {     
      @Override
      public String getUserId() {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        if (authentication == null) {
          throw new IllegalStateException("Unable to get a ConnectionRepository: no user signed in");
View Full Code Here

    cfConfig.addConnectionFactory(new LinkedInConnectionFactory(env.getProperty("linkedin.appKey"), env.getProperty("linkedin.appSecret")));
  }
 
  @Override
  public UserIdSource getUserIdSource() {
    return new UserIdSource() {     
      @Override
      public String getUserId() {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        if (authentication == null) {
          throw new IllegalStateException("Unable to get a ConnectionRepository: no user signed in");
View Full Code Here

TOP

Related Classes of org.springframework.social.UserIdSource

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.