Kileed Client v0.0.1 KileedClient View Source

Kileed client

This module helps interacting with a kileed authentication service.

Link to this section Summary

Functions

Tries to validate and commit user’s answer to challenge

Starts authorizing a kileed session with phone number

Link to this section Types

Link to this type errors() View Source
errors() ::
  :unknown
  | :service_blocked_ip
  | :service_auth
  | :property_blocked
  | :client_blocked_ip
  | :delivery_error
Link to this type kileed_session() View Source
kileed_session() :: %{
  id: integer(),
  login_on: String.t(),
  valid_from: DateTime.t(),
  valid_until: DateTime.t(),
  user_id: integer(),
  validate_by_request: integer(),
  service_id: integer()
}

Link to this section Functions

Link to this function commit_challenge(phone_number, challenge_answer, client_uid) View Source
commit_challenge(String.t(), String.t(), String.t()) ::
  {:ok, %{user_id: integer(), session: kileed_session()}} | {:error, errors()}

Tries to validate and commit user’s answer to challenge.

Parameters

  • phone_number: The phone number to commit challenge. (Same as the one which challenge started with
  • challenge_answer: User’s answer to chanllenge as string.
  • client_uid: Client’s unique identifire. (Usually the IP Address)
Link to this function start_challenge(phone_number, client_uid) View Source
start_challenge(String.t(), String.t()) :: :ok | {:error, errors()}

Starts authorizing a kileed session with phone number.

Parameters

  • phone_number: The client phone number to authorize
  • client_uid: A unique identifire of client. (Usually the client IP Address)