Bouncer.Plugs.Authorize

The Authorize plug can be used to scan a connection for an authorization token and use it to retrieve a user session so it can be added to the connection.

Summary

Functions

Extracts the authorization header from the connection, extracts the authorization token from the header, and finally adds the token to the connection

Assigns the extracted authorization token to the connection

Extracts an authorization token from the request header and adds it back into the connection. Retreives a user’s session information from the session store using the authorization token and adds that information back into the connection

Extracts the value of the request authorization header

Extracts the authorization token out of the request header value

Functions

assign_auth_token(conn)

Extracts the authorization header from the connection, extracts the authorization token from the header, and finally adds the token to the connection.

assign_auth_token(token, conn)

Assigns the extracted authorization token to the connection.

call(conn, )

Extracts an authorization token from the request header and adds it back into the connection. Retreives a user’s session information from the session store using the authorization token and adds that information back into the connection.

get_auth_header(conn)

Extracts the value of the request authorization header.

get_auth_token(header_value)

Extracts the authorization token out of the request header value.

Examples

iex> Bouncer.Plugs.Authorize.get_auth_token "Bearer: test"
"test"
iex> Bouncer.Plugs.Authorize.get_auth_token nil
nil
init(options)