Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
[fix] fixes #56: prohibit login for users with role=student for radiu…
Browse files Browse the repository at this point in the history
…s authentication when disabled
  • Loading branch information
smee committed Aug 30, 2010
1 parent 5abf34d commit 4b81b7f
Showing 1 changed file with 2 additions and 6 deletions.
Expand Up @@ -87,9 +87,6 @@ public Authentication authenticate(final Authentication authentication)
messageSourceAccessor.getMessage("AbstractUserDetailsAuthenticationProvider.onlySupports",
"Only UsernamePasswordAuthenticationToken is supported"));

if (!configManager.isStudentsLoginEnabled()) {
throw new AuthenticationServiceException("Login disabled for student role.");
}

if (!StringUtils.isEmpty(configManager.getRadiusHost()) && !StringUtils.isEmpty(configManager.getRadiusSharedSecret())) {

Expand All @@ -103,9 +100,8 @@ public Authentication authenticate(final Authentication authentication)

userBean = getRemoteUserInfos(username, password);

if (!userBean.getRole().equals("student")) {
throw new AuthenticationServiceException("Only student role allowed.");
}
if (userBean.getRole().equals("student") && !configManager.isStudentsLoginEnabled())
throw new AuthenticationServiceException("Login disabled for student role.");

try {

Expand Down

0 comments on commit 4b81b7f

Please sign in to comment.