AdminAuthFilter

class AdminAuthFilter : Filter

Auth filter for the admin servlet to ensure that it checks against the configured adminAuthToken

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
private fun checkToken(request: ServletRequest, response: ServletResponse)

Extract the basic auth info from the ServletRequest and compare against the configured token. If unable to match, then set HttpServletResponse.SC_UNAUTHORIZED and throw an Exception to prevent the chain from processing.

Link copied to clipboard
open override fun destroy()
Link copied to clipboard
open override fun doFilter(request: ServletRequest, response: ServletResponse, chain: FilterChain)

If there's a configured auth token, call checkToken before resuming the chain processing

Link copied to clipboard
open override fun init(filterConfig: FilterConfig?)

Read configured token and realm from the FilterConfig

Properties

Link copied to clipboard
private val base64: Base64.Decoder
Link copied to clipboard
private var realm: String
Link copied to clipboard
private var token: String?