public class AuthorizedKeysAuthenticator extends ModifiableFileWatcher implements PublickeyAuthenticator
PublickeyAuthenticator
while automatically re-loading the keys if the file has changed when a
new authentication request is received. Note: by default, the only
validation of the username is that it is not null
/empty - see
isValidUsername(String, ServerSession)
options, STRICTLY_PROHIBITED_FILE_PERMISSION
log
Constructor and Description |
---|
AuthorizedKeysAuthenticator(File file) |
AuthorizedKeysAuthenticator(Path file) |
AuthorizedKeysAuthenticator(Path file,
LinkOption... options) |
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(String username,
PublicKey key,
ServerSession session)
Check the validity of a public key.
|
protected PublicKeyEntryResolver |
getFallbackPublicKeyEntryResolver() |
protected boolean |
isValidUsername(String username,
ServerSession session) |
protected Collection<AuthorizedKeyEntry> |
reloadAuthorizedKeys(Path path,
String username,
ServerSession session) |
protected PublickeyAuthenticator |
resolvePublickeyAuthenticator(String username,
ServerSession session) |
checkReloadRequired, exists, getPath, lastModified, resetReloadAttributes, size, toString, updateReloadAttributes, validateStrictConfigFilePermissions
public AuthorizedKeysAuthenticator(File file)
public AuthorizedKeysAuthenticator(Path file)
public AuthorizedKeysAuthenticator(Path file, LinkOption... options)
public boolean authenticate(String username, PublicKey key, ServerSession session)
PublickeyAuthenticator
authenticate
in interface PublickeyAuthenticator
username
- the usernamekey
- the keysession
- the server sessionprotected boolean isValidUsername(String username, ServerSession session)
protected PublickeyAuthenticator resolvePublickeyAuthenticator(String username, ServerSession session) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
protected PublicKeyEntryResolver getFallbackPublicKeyEntryResolver()
protected Collection<AuthorizedKeyEntry> reloadAuthorizedKeys(Path path, String username, ServerSession session) throws IOException
IOException
Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.