Module watts_oidc_client

the OpenID Connect client implementation for WaTTS.

Behaviours: oidcc_client.

See also: watts_http_api.

Description

the OpenID Connect client implementation for WaTTS. This modules handles the login trys at the web inteface only, the logins using the dropdown at the javascript ui, not the logins by access tokens at the api.

Function Index

bin_error_msg/2*conver an error and the details into a binary error message.
error_msg/2*conver an error and the details into a string error message.
get_cookie_session_type/1*get the session and its type from cookie data.
get_return_url/2*get the urls from the rsp and retrun the on that fits the result.
get_session_type/1*get the session and its type from a cowboy request.
handle_failed_for_session/5*helper function to generate a redirect depending of the requests origin.
login_failed/2unused function to be compliant with behaviour.
login_failed/3handles a failed login of a user at the web interface (java script ui).
login_succeeded/1unused function to be compliant with behaviour.
login_succeeded/2handle the successful login of a user at an oidc provider.
redirect_back/3*redirect back depending on the result passed in.
redirect_error/2*redirect back to the main site with an error session to display.
redirect_set_cookie/2*redirect to the main site and set cookie depending on the session.
return_session_type/1*return the session and its type might also be undefined.
set_cookie/2*set the cookie for a given session or clear it.

Function Details

bin_error_msg/2 *

bin_error_msg(Reason::any(), Details::any()) -> binary()

conver an error and the details into a binary error message

error_msg/2 *

error_msg(Reason::any(), Details::any()) -> string()

conver an error and the details into a string error message

get_cookie_session_type/1 *

get_cookie_session_type(Other::any()) -> {atom() | tuple(), undefined | pid()}

get the session and its type from cookie data

get_return_url/2 *

get_return_url(X1::{ok | error, map()}, Rsp::watts_rsp:rsp()) -> binary()

get the urls from the rsp and retrun the on that fits the result.

get_session_type/1 *

get_session_type(X1::map()) -> {atom() | tuple(), undefined | pid()}

get the session and its type from a cowboy request

handle_failed_for_session/5 *

handle_failed_for_session(SessionType::any(), SessPid::pid(), EnvMap::map(), Reason::atom(), Details::any()) -> {ok, [tuple()]}

helper function to generate a redirect depending of the requests origin.

login_failed/2

login_failed(Reason::any(), Details::any()) -> {ok, [tuple()]}

unused function to be compliant with behaviour

login_failed/3

login_failed(Reason::atom(), Details::any(), EnvironmentMap::map()) -> {ok, [tuple()]}

handles a failed login of a user at the web interface (java script ui).

See also: login_succeeded/2.

login_succeeded/1

login_succeeded(TokenMap::any()) -> {ok, [tuple()]}

unused function to be compliant with behaviour

login_succeeded/2

login_succeeded(TokenMap::map(), EnvironmentMap::map()) -> {ok, [tuple()]}

handle the successful login of a user at an oidc provider. This only handles logins via the java script web interface, logins at the api using access tokens are handled directly at the api. This basically calls the watts:login_with_oidcc function and handles the result.

See also: watts_http_api, watts:login_with_oidcc/2.

redirect_back/3 *

redirect_back(Result::{ok | error, map()}, Session::pid(), EnvMap::map()) -> {ok, [tuple()]}

redirect back depending on the result passed in

redirect_error/2 *

redirect_error(ErrorMsg::binary(), EnvMap::map()) -> {ok, [tuple()]}

redirect back to the main site with an error session to display

redirect_set_cookie/2 *

redirect_set_cookie(Session::pid(), EnvMap::map()) -> {ok, [tuple()]}

redirect to the main site and set cookie depending on the session.

return_session_type/1 *

return_session_type(X1::any()) -> {atom() | tuple(), undefined | pid()}

return the session and its type might also be undefined

set_cookie/2 *

set_cookie(Session::pid() | undefined, EnvMap::map()) -> tuple()

set the cookie for a given session or clear it.


Generated by EDoc