@@ -3,6 +3,8 @@ module Api
3
3
# {https://auth0.com/docs/auth-api}
4
4
# Describing functionality of auth0 authentication endpoints
5
5
module AuthenticationEndpoints
6
+ UP_AUTH = 'Username-Password-Authentication'
7
+
6
8
# {https://auth0.com/docs/auth-api#!#post--oauth-access_token}
7
9
def obtain_access_token
8
10
request_params = {
@@ -44,7 +46,8 @@ def impersonate(user_id, app_client_id, impersonator_id, options)
44
46
end
45
47
46
48
# {https://auth0.com/docs/auth-api#!#post--oauth-ro}
47
- def login ( username , password , scope = 'openid' , id_token = nil , connection_name = 'Username-Password-Authentication' )
49
+
50
+ def login ( username , password , scope = 'openid' , id_token = nil , connection_name = UP_AUTH )
48
51
request_params = {
49
52
client_id : @client_id ,
50
53
username : username ,
@@ -58,7 +61,7 @@ def login(username, password, scope = 'openid', id_token = nil, connection_name
58
61
end
59
62
60
63
# {https://auth0.com/docs/auth-api#!#post--dbconnections-signup}
61
- def signup ( email , password , connection_name = 'Username-Password-Authentication' )
64
+ def signup ( email , password , connection_name = UP_AUTH )
62
65
request_params = {
63
66
client_id : @client_id ,
64
67
email : email ,
@@ -69,7 +72,7 @@ def signup(email, password, connection_name = 'Username-Password-Authentication'
69
72
end
70
73
71
74
# {https://auth0.com/docs/auth-api#!#post--dbconnections-change_password}
72
- def change_password ( email , password , connection_name = 'Username-Password-Authentication' )
75
+ def change_password ( email , password , connection_name = UP_AUTH )
73
76
request_params = {
74
77
client_id : @client_id ,
75
78
email : email ,
0 commit comments