auth0_ex v0.3.2 Auth0Ex.Management.User View Source

A module representing users on Auth0

Link to this section Summary

Functions

Gets all the users

Creates a user for the specified connection

Deletes a user with a give user id

Deletes a user's multifactor provider

Get all Guardain enrollments for given user_id

Gets a specific user record with a given user id

Links the account specified in the body to the given user_id param

Get a user's log

Removes current Guardain recovery code and generates new one

Unlinks an identity from the target user, and it becomes a separated user again.

Updates a user's information given a user id

Link to this section Functions

Gets all the users

iex> Auth0Ex.Management.User.all()
iex> Auth0Ex.Management.User.all(fields: "name", q: "app_metadata.admin:'true'")
Link to this function

create(connection, body \\ %{}) View Source

Creates a user for the specified connection

iex> Auth0Ex.Management.User.create("test_connection", %{email: "test.user@email.com", username: "test_user_name"})

Deletes a user with a give user id

iex> Auth0Ex.Management.User.delete("auth0|some_user_id")
Link to this function

delete_mfprovider(user_id, provider) View Source

Deletes a user's multifactor provider

iex> Auth0Ex.Management.User.delete_mfprovider("auth0|23423", "duo")

Get all Guardain enrollments for given user_id

iex> Auth0Ex.Management.User.enrollments("auth0|234")
Link to this function

get(user_id, params \\ %{}) View Source

Gets a specific user record with a given user id

iex> Auth0Ex.Management.User.get("auth0|some_user_id")
iex> Auth0Ex.Management.User.get("auth0|some_user_id", %{fields: "email,name,username"})

Links the account specified in the body to the given user_id param

iex> Auth0Ex.Management.User.link("some_user_id", link_with: "secondary_acc_jwt")
iex> Auth0Ex.Management.User.link("some_user_id", provider: "github", user_id: "23423", connection_id: "som")

Get a user's log

iex> Auth0Ex.Management.User.log("auth0|233423")
iex> Auth0Ex.Management.User.log("auth0|23423", page: 2, per_page: 10)
Link to this function

regenerate_recovery_code(id) View Source

Removes current Guardain recovery code and generates new one

iex> Auth0Ex.Management.User.regenerate_recovery_code("auth0|34234")
Link to this function

unlink(primary_id, provider, secondary_id) View Source

Unlinks an identity from the target user, and it becomes a separated user again.

iex> Auth0Ex.Management.User.unlink("some_user_id", "github", "23984234")
Link to this function

update(user_id, body \\ %{}) View Source

Updates a user's information given a user id

iex> Auth0Ex.Management.User.update("auth0|some_user_id", %{app_metadata: %{admin: false}})