Examples of InMemoryClientDetailsService


Examples of org.springframework.security.oauth2.provider.InMemoryClientDetailsService

    public void init(AuthenticationManagerBuilder builder) throws Exception {
        Map<String,ClientDetails> clientDetails = new HashMap<String,ClientDetails>(clientBuilders.size());
        for(ClientBuilder clientDetailsBldr : clientBuilders) {
            clientDetails.put(clientDetailsBldr.clientId, clientDetailsBldr.build());
        }
        InMemoryClientDetailsService clientDetailsService = new InMemoryClientDetailsService();
        clientDetailsService.setClientDetailsStore(clientDetails);

        ClientDetailsUserDetailsService userDetailsService = new ClientDetailsUserDetailsService(clientDetailsService);
        builder.userDetailsService(userDetailsService);

        builder.setSharedObject(ClientDetailsService.class, clientDetailsService);
View Full Code Here

Examples of org.springframework.security.oauth2.provider.client.InMemoryClientDetailsService

  public void init() {
    AuthorizationRequest authorizationRequest = new AuthorizationRequest();
    authorizationRequest.setClientId("client");
    authorizationRequest.setScope(Arrays.asList("read", "write"));
    authentication = new OAuth2Authentication(authorizationRequest.createOAuth2Request(), userAuthentication);
    InMemoryClientDetailsService clientDetailsService = new InMemoryClientDetailsService();
    client = new BaseClientDetails("client", "source", "read,write", "authorization_code,client_credentials",
        "read");
    clientDetailsService.setClientDetailsStore(Collections.singletonMap("client", client));
    voter.setClientDetailsService(clientDetailsService);
  }
View Full Code Here

Examples of org.springframework.security.oauth2.provider.client.InMemoryClientDetailsService

  @EnableWebSecurity
  protected static class TokenServicesContext {

    @Bean
    protected ClientDetailsService clientDetailsService() {
      return new InMemoryClientDetailsService();
    }
View Full Code Here

Examples of org.springframework.security.oauth2.provider.client.InMemoryClientDetailsService

  private Authentication userAuthentication;

  @Before
  public void init() {
    handler.setApprovalStore(store);
    InMemoryClientDetailsService clientDetailsService = new InMemoryClientDetailsService();
    Map<String, ClientDetails> map = new HashMap<String, ClientDetails>();
    map.put("client", new BaseClientDetails("client", null, "read,write", "authorization_code", null));
    clientDetailsService.setClientDetailsStore(map);
    handler.setRequestFactory(new DefaultOAuth2RequestFactory(clientDetailsService));
    userAuthentication = new UsernamePasswordAuthenticationToken("user", "N/A",
        AuthorityUtils.commaSeparatedStringToAuthorityList("USER"));
  }
View Full Code Here

Examples of org.springframework.security.oauth2.provider.client.InMemoryClientDetailsService

    clientDetails.put(clientId, value);
  }

  @Override
  protected ClientDetailsService performBuild() {
    InMemoryClientDetailsService clientDetailsService = new InMemoryClientDetailsService();
    clientDetailsService.setClientDetailsStore(clientDetails);
    return clientDetailsService;
  }
View Full Code Here

Examples of org.springframework.security.oauth2.provider.client.InMemoryClientDetailsService

    return approvalStoreDisabled || (tokenStore() instanceof JwtTokenStore);
  }

  private ClientDetailsService clientDetailsService() {
    if (clientDetailsService == null) {
      this.clientDetailsService = new InMemoryClientDetailsService();
    }
    return this.clientDetailsService;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.