Class KerberosUsernamePasswordAuthenticator
- java.lang.Object
-
- org.keycloak.federation.kerberos.impl.KerberosUsernamePasswordAuthenticator
-
public class KerberosUsernamePasswordAuthenticator extends Object
- Author:
- Marek Posolda
-
-
Field Summary
Fields Modifier and Type Field Description protected CommonKerberosConfigconfig
-
Constructor Summary
Constructors Constructor Description KerberosUsernamePasswordAuthenticator(CommonKerberosConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SubjectauthenticateSubject(String username, String password)Returns true if user was successfully authenticated against Kerberosprotected voidcheckKerberosServerAvailable(LoginException le)protected voidcheckKerberosUsername(LoginException le)protected CallbackHandlercreateJaasCallbackHandler(String principal, String password)protected ConfigurationcreateJaasConfiguration()protected StringgetKerberosPrincipal(String username)booleanisUserAvailable(String username)Returns true if user with given username exists in kerberos databasevoidlogoutSubject()booleanvalidUser(String username, String password)Returns true if user was successfully authenticated against Kerberos
-
-
-
Field Detail
-
config
protected final CommonKerberosConfig config
-
-
Constructor Detail
-
KerberosUsernamePasswordAuthenticator
public KerberosUsernamePasswordAuthenticator(CommonKerberosConfig config)
-
-
Method Detail
-
isUserAvailable
public boolean isUserAvailable(String username)
Returns true if user with given username exists in kerberos database- Parameters:
username- username without Kerberos realm attached or with correct realm attached- Returns:
- true if user available
-
validUser
public boolean validUser(String username, String password)
Returns true if user was successfully authenticated against Kerberos- Parameters:
username- username without Kerberos realm attached or with correct realm attachedpassword- kerberos password- Returns:
- true if user was successfully authenticated
-
checkKerberosServerAvailable
protected void checkKerberosServerAvailable(LoginException le)
-
checkKerberosUsername
protected void checkKerberosUsername(LoginException le)
-
authenticateSubject
public Subject authenticateSubject(String username, String password) throws LoginException
Returns true if user was successfully authenticated against Kerberos- Parameters:
username- username without Kerberos realm attachedpassword- kerberos password- Returns:
- true if user was successfully authenticated
- Throws:
LoginException
-
logoutSubject
public void logoutSubject()
-
getKerberosPrincipal
protected String getKerberosPrincipal(String username) throws LoginException
- Throws:
LoginException
-
createJaasCallbackHandler
protected CallbackHandler createJaasCallbackHandler(String principal, String password)
-
createJaasConfiguration
protected Configuration createJaasConfiguration()
-
-