auth.basic package
public struct AuthenticationInfo
Represents an authentication decision about a user
Field Name | Data Type | Description | Default Value |
---|---|---|---|
username | string | user name | |
isAuthenticated | boolean | authentication decision, true if authenticated, else false |
-
<AuthenticationInfo> AuthenticationInfo.<init>()
public struct BasicAuthenticator
Represents a Basic Authenticator
Field Name | Data Type | Description | Default Value |
---|---|---|---|
userStore | UserStore | UserStore object; ex.: in basic authenticator, the user store | [] |
authCache | cachingCache | null | Authentication cache object |
-
<BasicAuthenticator> authenticate(string username, string password) returns (boolean)
Performs basic authentication with the given username and password
Parameter Name Data Type Description username string user name password string password Return Variable Data Type Description boolean boolean: true if authentication is successful, else false -
<BasicAuthenticator> cacheAuthResult(string basicAuthCacheKey, AuthenticationInfo authInfo)
Caches the authentication result
Parameter Name Data Type Description basicAuthCacheKey string basic authentication cache key - sha256(basic auth header) authInfo AuthenticationInfo AuthenticationInfo instance containing authentication decision -
<BasicAuthenticator> clearCachedAuthResult(string basicAuthCacheKey)
Clears any cached authentication result
Parameter Name Data Type Description basicAuthCacheKey string basic authentication cache key - sha256(basic auth header) -
<BasicAuthenticator> getCachedAuthResult(string basicAuthCacheKey) returns (any)
Retrieves the cached authentication result if any, for the given basic auth header value
Parameter Name Data Type Description basicAuthCacheKey string basic authentication cache key - sha256(basic auth header) Return Variable Data Type Description any any: cached entry, or null in a cache miss -
<BasicAuthenticator> BasicAuthenticator.<init>()
public function createAuthenticationInfo(string username, boolean isAuthenticated) returns (AuthenticationInfo)
Creates AuthenticationInfo instance
Parameter Name | Data Type | Description |
---|---|---|
username | string | user name |
isAuthenticated | boolean | authentication decision |
Return Variable | Data Type | Description |
---|---|---|
AuthenticationInfo | AuthenticationInfo: Authentication decision instance, whether the user is authenticated or not |
public function createAuthenticator(UserStore userStore, cachingCache | null cache) returns (BasicAuthenticator)
Creates a Basic Authenticator
Parameter Name | Data Type | Description |
---|---|---|
userStore | UserStore | implementation of the credentials store - ldap, jdbc, file based userstore, etc. |
cache | cachingCache | null | cache instance |
Return Variable | Data Type | Description |
---|---|---|
BasicAuthenticator | BasicAuthenticator instance |