mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-22 12:48:58 +08:00
🐛 Fixing a bug. #I8AOYB 客户端模式,请求接口提示错误
This commit is contained in:
parent
7fc753d85a
commit
99c7edf03e
@ -12,6 +12,7 @@ import org.springframework.security.core.authority.AuthorityUtils;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.security.oauth2.core.AuthorizationGrantType;
|
||||
import org.springframework.security.oauth2.core.DefaultOAuth2AuthenticatedPrincipal;
|
||||
import org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal;
|
||||
import org.springframework.security.oauth2.server.authorization.OAuth2Authorization;
|
||||
import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService;
|
||||
@ -44,8 +45,8 @@ public class PigCustomOpaqueTokenIntrospector implements OpaqueTokenIntrospector
|
||||
|
||||
// 客户端模式默认返回
|
||||
if (AuthorizationGrantType.CLIENT_CREDENTIALS.equals(oldAuthorization.getAuthorizationGrantType())) {
|
||||
return new PigClientCredentialsOAuth2AuthenticatedPrincipal(oldAuthorization.getAttributes(),
|
||||
AuthorityUtils.NO_AUTHORITIES, oldAuthorization.getPrincipalName());
|
||||
return new DefaultOAuth2AuthenticatedPrincipal(oldAuthorization.getPrincipalName(),
|
||||
Objects.requireNonNull(oldAuthorization.getAccessToken().getClaims()), AuthorityUtils.NO_AUTHORITIES);
|
||||
}
|
||||
|
||||
Map<String, PigUserDetailsService> userDetailsServiceMap = SpringUtil
|
||||
|
Loading…
Reference in New Issue
Block a user