UserHashedTableAuth

class UserHashedTableAuth

Simple in-memory table that keeps user names and password hashes

Constructors

<init>

UserHashedTableAuth(table: Map<String, ByteArray>)
UserHashedTableAuth(config: ApplicationConfig)
UserHashedTableAuth(
    digester: (String) -> ByteArray,
    table: Map<String, ByteArray>)

Simple in-memory table that keeps user names and password hashes

Properties

digester

val digester: (String) -> ByteArray

a hash function to compute password digest

table

val table: Map<String, ByteArray>

of user names and hashed passwords

Functions

authenticate

fun authenticate(
    credential: UserPasswordCredential
): UserIdPrincipal?

Authenticate user by credential and return an instance of UserIdPrincipal if the credential pair is valid