Package org.springframework.security.oauth2.provider.token.store

Examples of org.springframework.security.oauth2.provider.token.store.JwtTokenStore


    return newClient;
  }
 
  private OAuth2AccessTokenEntity fetchValidRegistrationToken(OAuth2Authentication auth, ClientDetailsEntity client) {
   
    OAuth2AuthenticationDetails details = (OAuth2AuthenticationDetails) auth.getDetails();
    OAuth2AccessTokenEntity token = tokenService.readAccessToken(details.getTokenValue());
   
    if (config.getRegTokenLifeTime() != null) {
   
      try {
        // Re-issue the token if it has been issued before [currentTime - validity]
View Full Code Here


    return newClient;
  }
 
  private OAuth2AccessTokenEntity fetchValidRegistrationToken(OAuth2Authentication auth, ClientDetailsEntity client) {
   
    OAuth2AuthenticationDetails details = (OAuth2AuthenticationDetails) auth.getDetails();
    OAuth2AccessTokenEntity token = tokenService.readAccessToken(details.getTokenValue());
   
    if (config.getRegTokenLifeTime() != null) {
   
      try {
        // Re-issue the token if it has been issued before [currentTime - validity]
View Full Code Here

    @EnableGlobalMethodSecurity(prePostEnabled = true, jsr250Enabled = true)
    private static class GlobalSecurityConfiguration extends GlobalMethodSecurityConfiguration {<% if (authenticationType == 'token') { %>

        @Override
        protected MethodSecurityExpressionHandler createExpressionHandler() {
            return new OAuth2MethodSecurityExpressionHandler();
        }<% } %>
View Full Code Here

  private OAuth2RequestFactory defaultOAuth2RequestFactory;

  public void afterPropertiesSet() throws Exception {
    Assert.state(tokenGranter != null, "TokenGranter must be provided");
    Assert.state(clientDetailsService != null, "ClientDetailsService must be provided");
    defaultOAuth2RequestFactory = new DefaultOAuth2RequestFactory(getClientDetailsService());
    if (oAuth2RequestFactory == null) {
      oAuth2RequestFactory = defaultOAuth2RequestFactory;
    }
  }
View Full Code Here

      endpoints.tokenStore(tokenStore()).tokenEnhancer(jwtTokenEnhancer());
    }

    @Bean
    public TokenStore tokenStore() {
      return new JwtTokenStore(jwtTokenEnhancer());
    }
View Full Code Here

  public void init() throws Exception {
    tokenServices.setClientDetailsService(new InMemoryClientDetailsServiceBuilder().withClient("client")
        .authorizedGrantTypes("authorization_code").scopes("read").secret("secret").and().build());
    enhancer.setTokenEnhancers(Arrays.<TokenEnhancer> asList(jwtTokenEnhancer));
    jwtTokenEnhancer.afterPropertiesSet();
    tokenServices.setTokenStore(new JwtTokenStore(jwtTokenEnhancer));
    tokenServices.setTokenEnhancer(enhancer);
  }
View Full Code Here

  @Bean
  public JwtTokenStore tokenStore() throws Exception {
    JwtAccessTokenConverter enhancer = new JwtAccessTokenConverter();
    // N.B. in a real system you would have to configure the verifierKey (or use JdbcTokenStore)
    enhancer.afterPropertiesSet();
    return new JwtTokenStore(enhancer);
  }
View Full Code Here

  @Configuration
  protected static class OAuth2Config {

    @Bean
    public JwtTokenStore tokenStore() {
      JwtTokenStore store = new JwtTokenStore(tokenEnhancer());
      return store;
    }
View Full Code Here

  private JwtTokenStore tokenStore;
  JwtAccessTokenConverter enhancer = new JwtAccessTokenConverter();

  @Override
  protected TokenStore createTokenStore() {
    tokenStore = new JwtTokenStore(enhancer);
    return tokenStore;
  }
View Full Code Here

  }

  private TokenStore tokenStore() {
    if (tokenStore == null) {
      if (accessTokenConverter() instanceof JwtAccessTokenConverter) {
        this.tokenStore = new JwtTokenStore((JwtAccessTokenConverter) accessTokenConverter());
      }
      else {
        this.tokenStore = new InMemoryTokenStore();
      }
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.oauth2.provider.token.store.JwtTokenStore

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.