public class AuthnTableBasedService extends Object implements AuthenticationService
| Constructor and Description |
|---|
AuthnTableBasedService() |
| Modifier and Type | Method and Description |
|---|---|
protected static boolean |
checkpw(String password,
String hash) |
String |
createToken(String key,
Map<String,String> headers) |
String |
createToken(String key,
String secret,
Map<String,String> headers) |
Authenticator.SaslNegotiator |
getSaslNegotiator(Authenticator.SaslNegotiator wrapped,
ClientInfo clientInfo) |
void |
saveToken(String key,
UUID token)
Stores a token and key in the
AUTH_TABLE with the proper TTL settings. |
void |
setDataStoreFactory(DataStoreFactory dataStoreFactory) |
AuthenticationSubject |
validateToken(String token) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvalidateToken, validateTokenpublic void setDataStoreFactory(DataStoreFactory dataStoreFactory)
public String createToken(String key, String secret, Map<String,String> headers) throws UnauthorizedException
createToken in interface AuthenticationServiceUnauthorizedExceptionpublic String createToken(String key, Map<String,String> headers) throws UnauthorizedException
createToken in interface AuthenticationServiceUnauthorizedExceptionpublic void saveToken(String key, UUID token)
AUTH_TABLE with the proper TTL settings. Intended to be
used as part of createToken within this class or in conjunction with another auth service where
you wish to authenticate with one mechanism initially but still want the ability to hand out a
time bound token for further authentication.key - The key which is to be associated with the token.token - The token to be stored and used in later requests.public AuthenticationSubject validateToken(String token) throws UnauthorizedException
validateToken in interface AuthenticationServiceUnauthorizedExceptionpublic Authenticator.SaslNegotiator getSaslNegotiator(Authenticator.SaslNegotiator wrapped, ClientInfo clientInfo)
getSaslNegotiator in interface AuthenticationServiceCopyright © 2021. All rights reserved.