Merge pull request #875 from mposolda/master

Allow login modules to be more flexible
This commit is contained in:
Marek Posolda 2014-11-28 20:08:41 +01:00
commit 3e8495f435
2 changed files with 1 additions and 9 deletions

View file

@ -16,11 +16,7 @@ public class BearerTokenLoginModule extends AbstractKeycloakLoginModule {
@Override
protected Auth doAuth(String username, String password) throws VerificationException {
if (!"Bearer".equalsIgnoreCase(username)) {
log.debug("Username is expected to be bearer but is " + username + ". Ignoring login module");
return null;
}
// Should do some checking of authenticated username if it's equivalent to passed value?
return bearerAuth(password);
}

View file

@ -54,10 +54,6 @@ public class DirectAccessGrantsLoginModule extends AbstractKeycloakLoginModule {
@Override
protected Auth doAuth(String username, String password) throws IOException, VerificationException {
if ("Bearer".equalsIgnoreCase(username)) {
log.debug("Username is not expected to be bearer for this login module. Ignoring login module");
return null;
}
return directGrantAuth(username, password);
}