Auth Module
Authentication middleware for XRPC servers. Accepts a user-supplied verification function -- no direct crypto dependency.
Functions and values
| Function or value |
Description
|
Full Usage:
ClaimsPrincipalKey
Returns: string
|
Key used to store the authenticated ClaimsPrincipal in HttpContext.Items.
|
|
|
Full Usage:
getClaim claimType ctx
Parameters:
string
ctx : HttpContext
Returns: string option
|
Get a specific claim value from the authenticated principal.
|
|
Retrieve the authenticated ClaimsPrincipal from HttpContext.Items. Returns None if the request was not authenticated.
|
Full Usage:
verifyRequest verifyToken ctx
Parameters:
string -> Task<Result<ClaimsPrincipal, string>>
ctx : HttpContext
Returns: Task<Result<ClaimsPrincipal, string>>
|
Verify the request's bearer token using the supplied verification function. On success, stores the ClaimsPrincipal in HttpContext.Items. Returns Ok with the principal on success, or Error with a message on failure.
|