OAuth2AccessToken accessToken = createAccessToken(authentication, refreshToken); tokenStore.storeAccessToken(accessToken, authentication);
OAuth2AccessToken accessToken = createAccessToken(authentication, refreshToken); tokenStore.storeAccessToken(accessToken, authentication); if (!reuseRefreshToken) {
OAuth2Authentication auth = new OAuth2Authentication(oAuth2Request, authenticationToken); OAuth2AccessToken token = serviceTokenServices.createAccessToken(auth); log.trace("New Service token: " + token); return token;
@Override public OAuth2AccessToken createAccessToken(OAuth2Authentication authentication) throws AuthenticationException { OAuth2AccessToken token = super.createAccessToken(authentication); Account account = (Account) authentication.getPrincipal(); String jti = (String) token.getAdditionalInformation().get("jti"); blackListService.addToEnabledList( account.getId(), jti, token.getExpiration().getTime() ); return token; }
public AccessToken createAccessToken() { Set<String> scopes = new HashSet<String>(); scopes.add(Scope.GET.toString()); scopes.add(Scope.POST.toString()); scopes.add(Scope.PATCH.toString()); // Random scope, because the token services generates for every scope but same client // a different access token. This is only made due to the token expired problem, when the auth server // takes his actual access token, but the token is expired during the request to the resource server scopes.add(new Scope(UUID.randomUUID().toString()).toString()); DefaultAuthorizationRequest authorizationRequest = new DefaultAuthorizationRequest( OsiamAuthServerClientProvider.AUTH_SERVER_CLIENT_ID, scopes); authorizationRequest.setApproved(true); OAuth2Authentication oAuth2Authentication = new OAuth2Authentication(authorizationRequest, null); return new AccessToken.Builder(tokenServices.createAccessToken(oAuth2Authentication).getValue()).build(); } }
OAuth2AccessToken oAuth2AccessToken = defaultTokenServices.createAccessToken(oAuth2Authentication); LOGGER.debug("oAuth2AccessToken = " + oAuth2AccessToken);
OAuth2AccessToken accessToken = createAccessToken(authentication, refreshToken); tokenStore.storeAccessToken(accessToken, authentication);
OAuth2AccessToken accessToken = createAccessToken(authentication, refreshToken); tokenStore.storeAccessToken(accessToken, authentication); if (!reuseRefreshToken) {