Fetch user roles after a successful forced binded ldap login.

Signed-off-by: JACQUES Francois <fjacques@murex.com>
This commit is contained in:
JACQUES Francois 2016-02-17 12:57:57 +01:00
parent 8068aeead9
commit 1f75ab178c
1 changed files with 22 additions and 19 deletions

View File

@ -415,11 +415,14 @@ public class LdapLoginModule extends AbstractLoginModule
return isAuthenticated(); return isAuthenticated();
} }
boolean authed = false;
if (_forceBindingLogin) if (_forceBindingLogin)
{ {
return bindingLogin(webUserName, webCredential); authed = bindingLogin(webUserName, webCredential);
} }
else
{
// This sets read and the credential // This sets read and the credential
UserInfo userInfo = getUserInfo(webUserName); UserInfo userInfo = getUserInfo(webUserName);
@ -431,11 +434,11 @@ public class LdapLoginModule extends AbstractLoginModule
setCurrentUser(new JAASUserInfo(userInfo)); setCurrentUser(new JAASUserInfo(userInfo));
boolean authed = false;
if (webCredential instanceof String) if (webCredential instanceof String)
authed = credentialLogin(Credential.getCredential((String) webCredential)); authed = credentialLogin(Credential.getCredential((String) webCredential));
else else
authed = credentialLogin(webCredential); authed = credentialLogin(webCredential);
}
//only fetch roles if authenticated //only fetch roles if authenticated
if (authed) if (authed)