2727__copyright__ = "Copyright 2015-2016, LoginRadius"
2828__email__ = "developers@loginradius.com"
2929__status__ = "Production"
30- __version__ = "2.8"
30+ __version__ = "2.8.1 "
3131
3232SECURE_API_URL = "https://api.loginradius.com/"
3333HEADERS = {'Accept' : "application/json" }
@@ -128,7 +128,7 @@ def _get_user_tuple(self):
128128 """All the functions relative to the user with the token."""
129129 user = namedtuple ("User" , ['register_user' , 'create_user' , 'change_password' , 'edit_user' ,
130130 'get_user_by_id' , 'get_user_by_email' , 'get_account' , 'delete_account' , 'set_username' , 'generate_forgot_password_token' , 'check_email' ,
131- 'link_account' , 'unlink_account' , 'create_raas_profile' , 'authenticate_user' , 'delete_user_with_email_confirmation' , 'resend_verification_email'
131+ 'link_account' , 'unlink_account' , 'create_raas_profile' , 'authenticate_user' , 'authenticate_user_by_email' , ' delete_user_with_email_confirmation' , 'resend_verification_email'
132132 'delete_account_with_email_confirmation' , 'get_account_password' , 'get_custom_object_by_accountid' , 'get_custom_object_by_accountids' ,
133133 'check_custom_object' , 'get_custom_object_by_objectid' , 'get_custom_object_stats' , 'get_custom_object_by_query' , 'check_token_validate' , 'check_token_invalidate' ,
134134 'add_or_remove_user_email' , 'set_password' , 'set_status' , 'upsert_custom_object' ,
@@ -140,6 +140,7 @@ def _get_user_tuple(self):
140140 user .get_account = self .api .get_account
141141 user .delete_account = self .api .delete_account
142142 user .authenticate_user = self .api .authenticate_user
143+ user .authenticate_user_by_email = self .api .authenticate_user_by_email
143144 user .delete_user_with_email_confirmation = self .api .delete_user_with_email_confirmation
144145 user .generate_forgot_password_token = self .api .generate_forgot_password_token
145146 user .check_email = self .api .check_email
@@ -320,7 +321,14 @@ def delete_account(self, accountid):
320321 url = SECURE_API_URL + "raas/v1/account/delete"
321322 return self ._lr_object ._get_json (url , payload )
322323
323- def authenticate_user (self , emailid , password ):
324+ def authenticate_user (self , username , password ):
325+ """This API is used to authenticate users and returns the profile data associated with the authenticated user."""
326+ payload = {'appkey' : self ._lr_object ._get_api_key (), 'appsecret' : self ._lr_object ._get_api_secret (),
327+ 'username' : username , 'password' : password }
328+ url = SECURE_API_URL + "raas/v1/user"
329+ return self ._lr_object ._get_json (url , payload )
330+
331+ def authenticate_user_by_email (self , emailid , password ):
324332 """This API is used to authenticate users and returns the profile data associated with the authenticated user."""
325333 payload = {'appkey' : self ._lr_object ._get_api_key (), 'appsecret' : self ._lr_object ._get_api_secret (),
326334 'emailid' : emailid , 'password' : password }
0 commit comments