diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/UserInfo.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/UserInfo.java index 979c523a4..adea96314 100644 --- a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/UserInfo.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/UserInfo.java @@ -1,13 +1,5 @@ package org.mitre.openid.connect.model; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.OneToOne; -import javax.persistence.Table; public interface UserInfo { diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaUserInfoRepository.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaUserInfoRepository.java index 18cc7d61d..290b13585 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaUserInfoRepository.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaUserInfoRepository.java @@ -54,14 +54,15 @@ public class JpaUserInfoRepository implements UserInfoRepository { @Override @Transactional public UserInfo save(UserInfo userInfo) { - return saveOrUpdate(userInfo.getSub(), manager, userInfo); + DefaultUserInfo dui = (DefaultUserInfo)userInfo; + return saveOrUpdate(dui.getId(), manager, dui); } @Override @Transactional public void remove(UserInfo userInfo) { - - UserInfo found = manager.find(DefaultUserInfo.class, userInfo.getSub()); + DefaultUserInfo dui = (DefaultUserInfo)userInfo; + UserInfo found = manager.find(DefaultUserInfo.class, dui.getId()); if (found != null) { manager.remove(userInfo);