Tabnine Logo
org.springframework.security.oauth2.provider.token
Code IndexAdd Tabnine to your IDE (free)

How to use org.springframework.security.oauth2.provider.token

Best Java code snippets using org.springframework.security.oauth2.provider.token (Showing top 20 results out of 531)

origin: spring-projects/spring-security-oauth

protected void cancelToken(String value) {
  try {
    tokenServices.revokeToken(value);
  } catch (Exception e) {
    // ignore
  }
}
origin: spring-projects/spring-security-oauth

/**
 * Delegates to the internal instance {@link JwtTokenStore#readAuthentication(OAuth2AccessToken)}.
 *
 * @param token the access token
 * @return the {@link OAuth2Authentication} representation of the access token
 */
@Override
public OAuth2Authentication readAuthentication(OAuth2AccessToken token) {
  return this.delegate.readAuthentication(token);
}
origin: spring-projects/spring-security-oauth

protected OAuth2AccessToken getAccessToken(ClientDetails client, TokenRequest tokenRequest) {
  return tokenServices.createAccessToken(getOAuth2Authentication(client, tokenRequest));
}
origin: spring-projects/spring-security-oauth

private ResourceServerTokenServices tokenServices(HttpSecurity http) {
  if (resourceTokenServices != null) {
    return resourceTokenServices;
  }
  DefaultTokenServices tokenServices = new DefaultTokenServices();
  tokenServices.setTokenStore(tokenStore());
  tokenServices.setSupportRefreshToken(true);
  tokenServices.setClientDetailsService(clientDetails());
  this.resourceTokenServices = tokenServices;
  return tokenServices;
}
origin: spring-projects/spring-security-oauth

private DefaultTokenServices createDefaultTokenServices() {
  DefaultTokenServices tokenServices = new DefaultTokenServices();
  tokenServices.setTokenStore(tokenStore());
  tokenServices.setSupportRefreshToken(true);
  tokenServices.setReuseRefreshToken(reuseRefreshToken);
  tokenServices.setClientDetailsService(clientDetailsService());
  tokenServices.setTokenEnhancer(tokenEnhancer());
  addUserDetailsService(tokenServices, this.userDetailsService);
  return tokenServices;
}
origin: spring-projects/spring-security-oauth

public boolean revokeToken(String tokenValue) {
  OAuth2AccessToken accessToken = tokenStore.readAccessToken(tokenValue);
  if (accessToken == null) {
    return false;
  }
  if (accessToken.getRefreshToken() != null) {
    tokenStore.removeRefreshToken(accessToken.getRefreshToken());
  }
  tokenStore.removeAccessToken(accessToken);
  return true;
}
origin: spring-projects/spring-security-oauth

/**
 * Delegates to the internal instance {@link JwtTokenStore#readAccessToken(String)}.
 *
 * @param tokenValue the access token value
 * @return the {@link OAuth2AccessToken} representation of the access token value
 */
@Override
public OAuth2AccessToken readAccessToken(String tokenValue) {
  return this.delegate.readAccessToken(tokenValue);
}
origin: spring-projects/spring-security-oauth

/**
 * Delegates to the internal instance {@link JwtTokenStore#removeAccessToken(OAuth2AccessToken)}.
 *
 * @param token the access token
 */
@Override
public void removeAccessToken(OAuth2AccessToken token) {
  this.delegate.removeAccessToken(token);
}
origin: spring-projects/spring-security-oauth

private AccessTokenConverter accessTokenConverter() {
  if (this.accessTokenConverter == null) {
    accessTokenConverter = new DefaultAccessTokenConverter();
  }
  return this.accessTokenConverter;
}
origin: spring-projects/spring-security-oauth

/**
 * Loop over the {@link #setTokenEnhancers(List) delegates} passing the result into the next member of the chain.
 * 
 * @see org.springframework.security.oauth2.provider.token.TokenEnhancer#enhance(org.springframework.security.oauth2.common.OAuth2AccessToken,
 * org.springframework.security.oauth2.provider.OAuth2Authentication)
 */
public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) {
  OAuth2AccessToken result = accessToken;
  for (TokenEnhancer enhancer : delegates) {
    result = enhancer.enhance(result, authentication);
  }
  return result;
}
origin: spring-projects/spring-security-oauth

@Override
public OAuth2Authentication extractAuthentication(Map<String, ?> map) {
  return tokenConverter.extractAuthentication(map);
}
origin: spring-projects/spring-security-oauth

public OAuth2AccessToken getAccessToken(OAuth2Authentication authentication) {
  return tokenStore.getAccessToken(authentication);
}
origin: cloudfoundry/uaa

@Override
protected OAuth2AccessToken getAccessToken(ClientDetails client, TokenRequest tokenRequest) {
  return super.getAccessToken(client, tokenRequest);
}
origin: spring-projects/spring-security-oauth

@Override
public OAuth2AccessToken grant(String grantType, TokenRequest tokenRequest) {
  OAuth2AccessToken token = super.grant(grantType, tokenRequest);
  if (token != null) {
    DefaultOAuth2AccessToken norefresh = new DefaultOAuth2AccessToken(token);
    // The spec says that client credentials should not be allowed to get a refresh token
    if (!allowRefresh) {
      norefresh.setRefreshToken(null);
    }
    token = norefresh;
  }
  return token;
}
origin: spring-projects/spring-security-oauth

@Override
public OAuth2AccessToken extractAccessToken(String value, Map<String, ?> map) {
  return tokenConverter.extractAccessToken(value, map);
}
origin: spring-projects/spring-security-oauth

@Override
public Map<String, ?> convertAccessToken(OAuth2AccessToken token, OAuth2Authentication authentication) {
  return tokenConverter.convertAccessToken(token, authentication);
}
origin: cloudfoundry/uaa

@Override
protected OAuth2RequestFactory getRequestFactory() {
  return super.getRequestFactory();
}
origin: spring-projects/spring-security-oauth

@Bean
public DefaultTokenServices tokenServices() {
  DefaultTokenServices services = new DefaultTokenServices();
  services.setClientDetailsService(clientDetailsService);
  services.setSupportRefreshToken(true);
  services.setTokenStore(tokenStore());
  return services;
}
origin: spring-projects/spring-security-oauth

public OAuth2AccessToken readAccessToken(String accessToken) {
  return tokenStore.readAccessToken(accessToken);
}
origin: spring-projects/spring-security-oauth

/**
 * Delegates to the internal instance {@link JwtTokenStore#readAuthentication(String)}.
 *
 * @param tokenValue the access token value
 * @return the {@link OAuth2Authentication} representation of the access token
 */
@Override
public OAuth2Authentication readAuthentication(String tokenValue) {
  return this.delegate.readAuthentication(tokenValue);
}
org.springframework.security.oauth2.provider.token

Most used classes

  • JwtAccessTokenConverter
    Helper that translates between JWT encoded token values and OAuth authentication information (in bot
  • JwtTokenStore
    A TokenStore implementation that just reads data from the tokens themselves. Not really a store sinc
  • DefaultTokenServices
    Base implementation for token services using random UUID values for the access token and refresh tok
  • JdbcTokenStore
    Implementation of token services that stores tokens in a database.
  • RedisTokenStore
  • TokenStore,
  • KeyStoreKeyFactory,
  • DefaultAccessTokenConverter,
  • TokenEnhancerChain,
  • AuthorizationServerTokenServices,
  • RemoteTokenServices,
  • AuthenticationKeyGenerator,
  • ResourceServerTokenServices,
  • ConsumerTokenServices,
  • JwkTokenStore,
  • TokenEnhancer,
  • AccessTokenConverter,
  • DefaultUserAuthenticationConverter,
  • RedisTokenStoreSerializationStrategy
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now