auth_plug v0.8.0 AuthPlug

Link to this section Summary

Functions

call/2 is invoked to handle each HTTP request which auth_plug protects. If the conn contains a valid JWT in Authentication Headers, jwt query parameter or Phoenix Session, then continue to the protected route, else redirect to the auth_url with the referer set as the continuation URL.

init/1 initialises the options passed in and makes them available in the lifecycle of the call/2 invocation (below). We pass in the auth_url key/value with the URL of the Auth service to redirect to if session is invalid/expired.

session_options/0 returns the list of Phoenix/Plug Session options. This is useful if you need to check them or use them somewhere else.

setup_session/1 configures the Phoenix/Plug Session.

Link to this section Functions

Link to this function

call(conn, options)

call/2 is invoked to handle each HTTP request which auth_plug protects. If the conn contains a valid JWT in Authentication Headers, jwt query parameter or Phoenix Session, then continue to the protected route, else redirect to the auth_url with the referer set as the continuation URL.

init/1 initialises the options passed in and makes them available in the lifecycle of the call/2 invocation (below). We pass in the auth_url key/value with the URL of the Auth service to redirect to if session is invalid/expired.

Link to this function

session_options()

session_options/0 returns the list of Phoenix/Plug Session options. This is useful if you need to check them or use them somewhere else.

Link to this function

setup_session(conn)

setup_session/1 configures the Phoenix/Plug Session.