auth0_ex v0.3.1 Auth0Ex.Authentication.Login View Source

A module that handles login stuff for authentication API

Link to this section Summary

Functions

Given the user credentials and the connection specified, it will do the authentication on the provider and return a JSON with the access_token and id_token.

Given the social provider's access_token and the connection, this endpoint will authenticate the user with the provider and return a JSON with the access_token and, optionally, an id_token. This endpoint only works for Facebook, Google, Twitter and Weibo.

Link to this section Functions

Link to this function

database(client_id, username, password, connection, grant_type, params \\ %{}) View Source

Given the user credentials and the connection specified, it will do the authentication on the provider and return a JSON with the access_token and id_token.

You can pass optional parameters as a map in the last params argument.

An example params map would be:

%{scope: "openid app_metadata"}
%{device: "ios", id_token: "id_token_touchid"}


iex> Auth0Ex.Authentication.Login.database("client_id", "samar", "samarpwd", "dev", "password")
iex> Auth0Ex.Authentication.Login.database("client_id", "samar", "samarpwd", "dev", "password", %{scope: "openid app_metadata"})
Link to this function

social(client_id, access_token, connection, scope \\ "openid") View Source

Given the social provider's access_token and the connection, this endpoint will authenticate the user with the provider and return a JSON with the access_token and, optionally, an id_token. This endpoint only works for Facebook, Google, Twitter and Weibo.

iex> Auth0Ex.Authentication.Login.social("client_id", "access_token", "facebook")
iex> Auth0Ex.Authentication.Login.social("client_id", "access_token", "facebook", "openid profile email")