🔥 Removing code or files. 删除无用import

This commit is contained in:
lbw 2022-05-31 12:55:06 +08:00
parent e7783a4558
commit 4c2c8fb7bc
2 changed files with 2 additions and 15 deletions

View File

@ -27,10 +27,7 @@ import org.springframework.core.annotation.Order;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2AuthorizationServerConfigurer;
import org.springframework.security.oauth2.server.authorization.InMemoryOAuth2AuthorizationConsentService;
import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService;
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationCodeRequestAuthenticationProvider;
import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository;
import org.springframework.security.oauth2.server.authorization.config.ProviderSettings;
import org.springframework.security.oauth2.server.authorization.token.*;
import org.springframework.security.oauth2.server.authorization.web.authentication.*;
@ -149,13 +146,6 @@ public class AuthorizationServerConfiguration {
http.authenticationProvider(resourceOwnerPasswordAuthenticationProvider);
// 处理 OAuth2ResourceOwnerSmsAuthenticationToken
http.authenticationProvider(resourceOwnerSmsAuthenticationProvider);
RegisteredClientRepository clientRepository = http.getSharedObject(RegisteredClientRepository.class);
// 处理默认的授权模式
http.authenticationProvider(new OAuth2AuthorizationCodeRequestAuthenticationProvider(clientRepository,
authorizationService, new InMemoryOAuth2AuthorizationConsentService()));
}
}

View File

@ -24,10 +24,7 @@ import org.springframework.util.CollectionUtils;
import java.security.Principal;
import java.time.Instant;
import java.util.LinkedHashSet;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.function.Supplier;
/**
@ -196,7 +193,7 @@ public class OAuth2ResourceOwnerPasswordAuthenticationProvider implements Authen
LOGGER.debug("returning OAuth2AccessTokenAuthenticationToken");
return new OAuth2AccessTokenAuthenticationToken(registeredClient, clientPrincipal, accessToken,
refreshToken, authorization.getAccessToken().getClaims());
refreshToken, Objects.requireNonNull(authorization.getAccessToken().getClaims()));
}
catch (Exception ex) {