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 CommonKerberosConfig
config
-
Constructor Summary
Constructors Constructor Description KerberosUsernamePasswordAuthenticator(CommonKerberosConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Subject
authenticateSubject(String username, String password)
Returns true if user was successfully authenticated against Kerberosprotected void
checkKerberosServerAvailable(LoginException le)
protected void
checkKerberosUsername(LoginException le)
protected CallbackHandler
createJaasCallbackHandler(String principal, String password)
protected Configuration
createJaasConfiguration()
protected String
getKerberosPrincipal(String username)
boolean
isUserAvailable(String username)
Returns true if user with given username exists in kerberos databasevoid
logoutSubject()
boolean
validUser(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()
-
-