增加sonar测试并修复sonar测试的问题
This commit is contained in:
@@ -15,7 +15,7 @@ public class OpenIdAuthenticationProvider implements AuthenticationProvider {
|
||||
private SocialUserDetailsService userDetailsService;
|
||||
|
||||
@Override
|
||||
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
|
||||
public Authentication authenticate(Authentication authentication) {
|
||||
OpenIdAuthenticationToken authenticationToken = (OpenIdAuthenticationToken) authentication;
|
||||
String openId = (String) authenticationToken.getPrincipal();
|
||||
UserDetails user = userDetailsService.loadUserByUserId(openId);
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.central.oauth.openid;
|
||||
|
||||
import org.springframework.security.authentication.AbstractAuthenticationToken;
|
||||
@@ -66,7 +63,7 @@ public class OpenIdAuthenticationToken extends AbstractAuthenticationToken {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException {
|
||||
public void setAuthenticated(boolean isAuthenticated) {
|
||||
if (isAuthenticated) {
|
||||
throw new IllegalArgumentException(
|
||||
"Cannot set this token to trusted - use constructor which takes a GrantedAuthority list instead");
|
||||
|
||||
Reference in New Issue
Block a user