|
|
|
@ -60,6 +60,20 @@ public class SecuredUserInfo extends UserInfo implements UserDetails {
|
|
|
|
|
private List<Authority> authorities;
|
|
|
|
|
private boolean sealed;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getId(Object auth) {
|
|
|
|
|
UserInfo userInfo = null;
|
|
|
|
|
if (auth instanceof Authentication) {
|
|
|
|
|
Object obj = ((Authentication)auth).getPrincipal();
|
|
|
|
|
if (obj instanceof UserInfo)
|
|
|
|
|
userInfo = (UserInfo)obj;
|
|
|
|
|
}
|
|
|
|
|
if (userInfo == null)
|
|
|
|
|
throw new RuntimeException(String.format("Unable to get a UserInfo from %s", auth));
|
|
|
|
|
|
|
|
|
|
return userInfo.getId();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<Authority> getAuthorities() {
|
|
|
|
|
return authorities != null ? authorities : Collections.emptyList();
|
|
|
|
|