|
|
@ -6,6 +6,7 @@ import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.security.authentication.AuthenticationServiceException;
|
|
|
|
import org.springframework.security.authentication.AuthenticationServiceException;
|
|
|
|
import org.springframework.security.authentication.BadCredentialsException;
|
|
|
|
import org.springframework.security.authentication.BadCredentialsException;
|
|
|
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
|
|
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
|
|
@ -17,6 +18,7 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
|
|
|
import cokr.xit.base.security.AccessContext;
|
|
|
|
import cokr.xit.base.security.AccessContext;
|
|
|
|
import cokr.xit.base.security.Authority;
|
|
|
|
import cokr.xit.base.security.Authority;
|
|
|
|
import cokr.xit.base.security.SecuredUserInfo;
|
|
|
|
import cokr.xit.base.security.SecuredUserInfo;
|
|
|
|
|
|
|
|
import cokr.xit.base.security.UserDetailLoader;
|
|
|
|
import cokr.xit.base.security.access.dao.AuthorityMapper;
|
|
|
|
import cokr.xit.base.security.access.dao.AuthorityMapper;
|
|
|
|
import cokr.xit.base.security.authentication.AuthenticationPolicy;
|
|
|
|
import cokr.xit.base.security.authentication.AuthenticationPolicy;
|
|
|
|
import cokr.xit.base.security.authentication.service.AuthenticationService;
|
|
|
|
import cokr.xit.base.security.authentication.service.AuthenticationService;
|
|
|
@ -45,6 +47,8 @@ public class AuthenticationServiceBean extends DaoAuthenticationProvider impleme
|
|
|
|
/** 접근 권한 DAO */
|
|
|
|
/** 접근 권한 DAO */
|
|
|
|
@Resource(name="authorityMapper")
|
|
|
|
@Resource(name="authorityMapper")
|
|
|
|
private AuthorityMapper authorityMapper;
|
|
|
|
private AuthorityMapper authorityMapper;
|
|
|
|
|
|
|
|
@Autowired(required = false)
|
|
|
|
|
|
|
|
private UserDetailLoader userDetailLoader;
|
|
|
|
|
|
|
|
|
|
|
|
/**새 AuthenticationServiceBean를 생성한다.
|
|
|
|
/**새 AuthenticationServiceBean를 생성한다.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -69,7 +73,7 @@ public class AuthenticationServiceBean extends DaoAuthenticationProvider impleme
|
|
|
|
SecuredUserInfo userInfo = new SecuredUserInfo();
|
|
|
|
SecuredUserInfo userInfo = new SecuredUserInfo();
|
|
|
|
userInfo.setUser(user);
|
|
|
|
userInfo.setUser(user);
|
|
|
|
setAuthorities(userInfo);
|
|
|
|
setAuthorities(userInfo);
|
|
|
|
loadDetails(userInfo);
|
|
|
|
setDetails(userInfo);
|
|
|
|
|
|
|
|
|
|
|
|
return userInfo;
|
|
|
|
return userInfo;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -121,8 +125,7 @@ public class AuthenticationServiceBean extends DaoAuthenticationProvider impleme
|
|
|
|
SecuredUserInfo userInfo = new SecuredUserInfo();
|
|
|
|
SecuredUserInfo userInfo = new SecuredUserInfo();
|
|
|
|
userInfo.setUser(user);
|
|
|
|
userInfo.setUser(user);
|
|
|
|
setAuthorities(userInfo);
|
|
|
|
setAuthorities(userInfo);
|
|
|
|
loadDetails(userInfo);
|
|
|
|
setDetails(userInfo);
|
|
|
|
|
|
|
|
|
|
|
|
return userInfo;
|
|
|
|
return userInfo;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -141,7 +144,10 @@ public class AuthenticationServiceBean extends DaoAuthenticationProvider impleme
|
|
|
|
/**사용자 정보에 추가 정보를 설정한다.
|
|
|
|
/**사용자 정보에 추가 정보를 설정한다.
|
|
|
|
* @param user 사용자 정보
|
|
|
|
* @param user 사용자 정보
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
protected void loadDetails(UserInfo user) {}
|
|
|
|
protected void setDetails(SecuredUserInfo userInfo) {
|
|
|
|
|
|
|
|
if (userDetailLoader != null)
|
|
|
|
|
|
|
|
userDetailLoader.setInfo(userInfo);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**지정한 아이디의 권한을 가져온다.
|
|
|
|
/**지정한 아이디의 권한을 가져온다.
|
|
|
|
* @param authIDs 권한 아이디
|
|
|
|
* @param authIDs 권한 아이디
|
|
|
|