Commit ef08e868 authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

731: Finalize redirection to self service for incomplete accounts

Task-Url: https://minfba.de.dariah.eu/mantisbt/view.php?id=731
parent 83dc8480
......@@ -26,7 +26,4 @@ public interface User extends UserDetails, Identifiable {
public void setUsername(String username);
public void setExpired(boolean b);
public void setLastLogin(DateTime now);
public boolean isPersistent();
public void setPersistent(boolean persistent);
}
......@@ -17,7 +17,6 @@ public class UserImpl implements User {
private String language;
private boolean hasAllAttributes;
private DateTime lastLogin;
private boolean persistent;
public UserImpl() {}
......@@ -58,9 +57,6 @@ public class UserImpl implements User {
public DateTime getLastLogin() { return lastLogin; }
public void setLastLogin(DateTime lastLogin) { this.lastLogin = lastLogin; }
public boolean isPersistent() { return persistent; }
public void setPersistent(boolean persistent) { this.persistent = persistent; }
@Override public String getUsername() { return username; }
@Override public String getPassword() { return ""; }
......
......@@ -9,7 +9,6 @@ public class AuthPojo {
private int level;
private String displayName;
private String language;
private boolean persistent;
private List<String> roles;
public boolean isAuth() { return auth; }
......@@ -30,9 +29,6 @@ public class AuthPojo {
public String getLanguage() { return language; }
public void setLanguage(String language) { this.language = language; }
public boolean isPersistent() { return persistent; }
public void setPersistent(boolean persistent) { this.persistent = persistent; }
public List<String> getRoles() { return roles; }
public void setRoles(List<String> roles) { this.roles = roles; }
}
......@@ -114,8 +114,7 @@ public abstract class BaseUserService implements UserService, SAMLUserDetailsSer
authorizedUser.setAuthorities(roles);
authorizedUser.setExpired(!(localUserDetails.isAccountNonExpired() && localUserDetails.isAccountNonLocked() && localUserDetails.isCredentialsNonExpired() && localUserDetails.isEnabled()));
authorizedUser.setLastLogin(DateTime.now());
authorizedUser.setPersistent(true);
return authorizedUser;
}
......@@ -174,11 +173,7 @@ public abstract class BaseUserService implements UserService, SAMLUserDetailsSer
u.setHasAllAttributes(true);
u.setAuthorities(roles);
u.setOriginalAttributes(this.convertAttributes(credential.getAttributes()));
if (!credential.getNameID().getFormat().equals("urn:oasis:names:tc:SAML:2.0:nameid-format:transient")) {
u.setPersistent(true);
}
if (credential instanceof SAMLAggregatedCredential) {
u.setAggregatedAttributes(this.convertAttributes(((SAMLAggregatedCredential)credential).getAggregatedAttributes()));
u.setHasAllAttributes(((SAMLAggregatedCredential)credential).isHasAllAttributes());
......
......@@ -77,9 +77,6 @@ public class AuthInfoHelper {
logger.error("Failed to set maxAutorityLevel for user", e);
}
pojo.setUserId(((UserImpl)user).getId());
pojo.setPersistent(((UserImpl)user).isPersistent());
} else {
pojo.setPersistent(true);
}
}
return pojo;
......
......@@ -30,7 +30,6 @@
<tr><th>Authenticated:&nbsp;</th><td>${_auth!=null && _auth.auth==true}</td></tr>
<c:if test="${_auth!=null && _auth.auth==true}">
<tr><th>Display name:&nbsp;</th><td>${_auth.displayName}</td></tr>
<tr><th>Persistent:&nbsp;</th><td>${_auth.persistent}</td></tr>
</c:if>
</table>
</div>
......
......@@ -21,7 +21,7 @@
<ul class="nav navbar-nav navbar-right">
<c:set var="currentUrl" value="${requestScope['javax.servlet.forward.request_uri']}" />
<li id="login"<c:if test="${_auth!=null && _auth.auth==true}"> style="display: none;"</c:if>><a href="<s:url value='/login?url=${currentUrl}' />" ><span class="glyphicon glyphicon-log-in"></span>&nbsp;Login</a></li>
<li id="logout"<c:if test="${_auth==null || _auth.auth==false}"> style="display: none;"</c:if>><a href="<s:url value='/logout?url=${_logoutUrl}' />" ><span class="glyphicon glyphicon-log-out"></span>&nbsp;Logout<c:if test="${_auth!=null || _auth.auth==true}"> (${_auth.displayName})</c:if></a></li>
<li id="logout"<c:if test="${_auth==null || _auth.auth==false}"> style="display: none;"</c:if>><a href="<s:url value='/logout?url=${_logoutUrl}' />" ><span class="glyphicon glyphicon-log-out"></span>&nbsp;Logout</a></li>
</ul>
</nav>
......
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