Module: Auth0::Api::AuthenticationEndpoints

Defined in:
lib/auth0/api/authentication_endpoints.rb

Overview

https://auth0.com/docs/auth-api Describing functionality of auth0 authentication endpoints

Instance Method Summary collapse

Instance Method Details

#change_password(email, password, connection_name = "Username-Password-Authentication") ⇒ Object



54
55
56
57
58
59
60
61
62
# File 'lib/auth0/api/authentication_endpoints.rb', line 54

def change_password(email, password, connection_name = "Username-Password-Authentication")
  request_params = {
    client_id:  @client_id,
    email:      email,
    connection: connection_name,
    password:   password
  }
  post("/dbconnections/change_password", request_params)
end

#delegation(id_token, target, scope = "open_id") ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/auth0/api/authentication_endpoints.rb', line 17

def delegation(id_token, target, scope = "open_id")
  request_params = {
                client_id:  @client_id,
                grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer",
                id_token:   id_token,
                target:     target,
                scope:      scope
  }
  post("/delegation", request_params)
end

#login(username, password, scope = "openid", id_token = nil, connection_name = "Username-Password-Authentication") ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/auth0/api/authentication_endpoints.rb', line 29

def (username, password, scope = "openid", id_token=nil, connection_name="Username-Password-Authentication")
  request_params = {
    client_id:  @client_id,
    username:   username,
    password:   password,
    scope:      scope,
    connection: connection_name,
    grand_type: "password",
    id_token:   id_token
  }
  post("/oauth/ro", request_params)
end

#obtain_access_tokenObject



7
8
9
10
11
12
13
14
# File 'lib/auth0/api/authentication_endpoints.rb', line 7

def obtain_access_token
  request_params = {
      client_id:      @client_id,
      client_secret:  @client_secret,
      grant_type:     'client_credentials'
  }
  post("/oauth/token", request_params)["access_token"]
end

#signup(email, password, connection_name = "Username-Password-Authentication") ⇒ Object



43
44
45
46
47
48
49
50
51
# File 'lib/auth0/api/authentication_endpoints.rb', line 43

def (email, password, connection_name= "Username-Password-Authentication")
  request_params = {
    client_id:  @client_id,
    email:      email,
    connection: connection_name,
    password:   password
  }
  post("/dbconnections/signup", request_params)
end

#token_info(id_token) ⇒ Object



65
66
67
68
# File 'lib/auth0/api/authentication_endpoints.rb', line 65

def token_info(id_token)
  request_params = { id_token: id_token}
  post("/tokeninfo", request_params)
end