Guardsix.Auth.SessionProvider (guardsix v1.2.2)

Copy Markdown View Source

Establishes an authenticated browser session with a Guardsix instance.

Used for UI endpoints that do not support JWT authentication. This works by scraping the landing page for CSRF tokens and session cookies, then logging in via the same form the browser uses. This approach is unstable and may break if LogPoint changes its login flow or page structure.

Summary

Functions

Login as a user and get the session as a logged in user. This has currently only been tested with LogpointAuthentication as the auth method.

Functions

login(base_url, username, password, opts \\ [])

@spec login(String.t(), String.t(), String.t(), keyword()) ::
  {:ok, Guardsix.Data.Session.t()} | {:error, term()}

Login as a user and get the session as a logged in user. This has currently only been tested with LogpointAuthentication as the auth method.