Commit 483262e5 authored by michael.simon's avatar michael.simon
Browse files

Login with saml working for now

parent de3ce619
......@@ -129,7 +129,7 @@ public class JpaRoleDao extends JpaBaseDao<RoleEntity, Long> implements RoleDao
.setParameter("identityId", identityId).getResultList();
IdentityEntity identity = identityDao.findById(identityId);
roleList.addAll(em.createQuery("select r.role from UserRoleEntity r where r.user.id in :userIdList")
roleList.addAll(em.createQuery("select r.role from UserRoleEntity r where r.user in :userIdList")
.setParameter("userIdList", identity.getUsers()).getResultList());
return roleList;
......
......@@ -35,9 +35,6 @@ public class SessionManager implements Serializable {
private Long authnRequestId;
private Long authnRequestIdpConfigId;
// userId of logged in user accounts. Order is login order!
private List<Long> userIdList;
// identityId of the actual user
private Long identityId;
......@@ -80,7 +77,6 @@ public class SessionManager implements Serializable {
@PostConstruct
public void init() {
userIdList = new ArrayList<Long>();
serviceApproverList = new ArrayList<ServiceEntity>();
serviceSshPubKeyApproverList = new ArrayList<ServiceEntity>();
serviceAdminList = new ArrayList<ServiceEntity>();
......@@ -309,8 +305,4 @@ public class SessionManager implements Serializable {
public void setSubjectId(String subjectId) {
this.subjectId = subjectId;
}
public List<Long> getUserIdList() {
return userIdList;
}
}
......@@ -136,8 +136,8 @@ public class SecurityFilter implements Filter {
else if (session != null && session.isLoggedIn()) {
MDC.put("userId", "" + session.getIdentityId());
Set<RoleEntity> roles = new HashSet<RoleEntity>(roleService.findByUserIdList(session.getUserIdList()));
Set<RoleEntity> roles = new HashSet<RoleEntity>(roleService.findByIdentityId(session.getIdentityId()));
session.addRoles(roles);
if (accessChecker.check(path, roles)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment