View Source Boruta.BasicAuth (Boruta core v2.1.0)
HTTP BasicAuth utilities
Provide utilities to decode Basic authorization header as stated in RFC 7617 - The 'Basic' HTTP Authentication Scheme
Link to this section Summary
Functions
Decode given authorization header and returns an array containing username and password.
Link to this section Functions
Specs
Decode given authorization header and returns an array containing username and password.
Examples
iex> Boruta.BasicAuth.decode("Basic dXNlcm5hbWU6cGFzc3dvcmQ=")
{:ok, ["username", "password"]}
iex> Boruta.BasicAuth.decode("bad_authorization_header")
{:error, "`bad_authorization_header` is not a valid Basic authorization header."}