diff --git a/IronMan/api/authentication/api.py b/IronMan/api/authentication/api.py index d1db656..e3ff8be 100644 --- a/IronMan/api/authentication/api.py +++ b/IronMan/api/authentication/api.py @@ -13,20 +13,20 @@ def __init__(self, lr_object): self._lr_object = lr_object - def retrieve_user_identity(self, access_token, fields): + def retrieve_user_identity(self, access_token, fields = ''): """This API will return all the accepted privacy policies for the user by providing the access_token of that user. Args: access_token: Uniquely generated identifier key by IronMan that is activated after successful authentication. - - Returns: - Complete Policy History data - 15.2 + """ if(self._lr_object.is_null_or_whitespace(access_token)): raise Exception(self._lr_object.get_validation_message("access_token")) + if(not self._lr_object.is_null_or_whitespace(fields)): + query_parameters["fields"] = fields + query_parameters = {} query_parameters["access_token"] = access_token query_parameters["apiKey"] = self._lr_object.get_api_key() @@ -38,18 +38,7 @@ def retrieve_user_identity(self, access_token, fields): def register(self, payload, verification_url=None, email_template=None): """This API creates a user in the database as well as sends a verification email to the user. - Args: - payload: Model Class containing Definition of payload for Auth User Registration API - sott: IronMan Secured One Time Token - email_template: Email template name - fields: The fields parameter filters the API response so that the response only includes a specific set of fields - options: PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow) - verification_url: Email verification url - welcome_email_template: Name of the welcome email template - - Returns: - Response containing Definition of Complete Validation, UserProfile data and Access Token - 17.1.1 + """ if(payload is None): raise Exception(self._lr_object.get_validation_message("payload")) @@ -63,9 +52,33 @@ def register(self, payload, verification_url=None, email_template=None): query_parameters["verificationUrl"] = verification_url resource_path = "/v1/register" - print (resource_path) return self._lr_object.execute("POST", resource_path, query_parameters, payload) + + def login(self, payload, verification_url=None, email_template=None): + """This API is used to login a user. + + Args: + payload: Model Class containing Definition of payload for Auth User Registration API + email_template: Email template name + verification_url: Email verification url + + + """ + if(payload is None): + raise Exception(self._lr_object.get_validation_message("payload")) + + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + if(not self._lr_object.is_null_or_whitespace(email_template)): + query_parameters["emailTemplate"] = email_template + if(not self._lr_object.is_null_or_whitespace(verification_url)): + query_parameters["verificationUrl"] = verification_url + + resource_path = "/v1/login" + + return self._lr_object.execute("POST", resource_path, query_parameters, payload) @@ -74,12 +87,9 @@ def resend_email_verification(self, email): Args: email: user's email - email_template: Email template name - verification_url: Email verification url + - Returns: - Response containing Definition of Complete Validation data - 17.3 + """ if(self._lr_object.is_null_or_whitespace(email)): @@ -93,3 +103,59 @@ def resend_email_verification(self, email): resource_path = "/v1/email/resendverify" return self._lr_object.execute("PUT", resource_path, query_parameters, body_parameters) + + + def reset_user_password(self, resetPasswordEmailTemplate, resetToken, password): + """This API reset a user's password. + + Args: + resetPasswordEmailTemplate: The name of the template to be used to format the confirmation email sent to your user. + resetToken: The reset token retrieved from the recovery email previously sent to your user. + password: The new password to be used to authenticate your user. + + Returns: + Response containing Definition of Reset user password + """ + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + + query_parameters = {} + query_parameters["resetPasswordEmailTemplate"] = resetPasswordEmailTemplate + + body_parameters = {} + body_parameters["resetToken"] = resetToken + + body_parameters = {} + body_parameters["password"] = password + + resource_path = "/v1/password/reset" + return self._lr_object.execute("PUT", resource_path, query_parameters, body_parameters) + + + def change_user_password(self, access_token, oldPassword, newPassword): + """This API change a user's password. + + Args: + access_token: A access token. + oldPassword: The current password used to authenticate your user. + newPassword: The new password to be used to authenticate your user. + + Returns: + Response containing Definition of change user password + """ + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + + query_parameters = {} + query_parameters["access_token"] = access_token + + body_parameters = {} + body_parameters["oldPassword"] = oldPassword + + body_parameters = {} + body_parameters["newPassword"] = newPassword + + resource_path = "/v1/password/change" + return self._lr_object.execute("PUT", resource_path, query_parameters, body_parameters) diff --git a/README.md b/README.md index c870234..4512902 100644 --- a/README.md +++ b/README.md @@ -1 +1,6 @@ -We are Creating IronMan SDK For IO \ No newline at end of file +<<<<<<< HEAD +We are Creating IronMan SDK For IO +======= +# ironman +IO +>>>>>>> Initial commit diff --git a/Write-o-thon/project.md b/Write-o-thon/project.md new file mode 100644 index 0000000..6b19cfc --- /dev/null +++ b/Write-o-thon/project.md @@ -0,0 +1,57 @@ + +### LoginRadius helping business grow with customer experience + +To succeed in this competitive era of digital identity, companies need to pay close attention to their actual customer experience, the sum total of digital and in-person interactions that a customer faces with a specific brand. So at a baseline, a good customer experience needs to work, to deliver products and services with minimal worries. And if a company wants to stay out and stay ahead, that experience needs to be extraordinary, Unified, Personal and Pleasent. + +![enter image description here](https://apidocs.lrcontent.com/images/AA_195215dee2f4ce679e2.31293807.png "enter image title here") + +In today's world every customers know what a delightful experience feels like because they are already interacting with the world’s best organizations like Google, Amazon, Apple etc. So if a company’s user experience doesn’t make the rank, it’s easy for people to switch to other brands. But if you can pull off a digital transformation that makes it easy and enjoyable for people to be your customers, you will pull in more revenue and stay competitive. + +So keeping these all requirements in mind and to heart, below are some key features of LoginRadius which helps business grow with customer experience: + +- **Increase conversion** : When a user enters as a visitor LoginRadius customer experience makes sure that the vistor ends in a registered user. The basic funamental which LoginRadius follow here is the more easy to get registered, the more user will attract. + + ![enter image description here](https://apidocs.lrcontent.com/images/A_34535dee2eba1bbf56.67636508.png "enter image title here") + +- **Quick and no-time registration** : When many organizations still go with a basic and lengthy registration process, LoginRadius makes sure that every user gets a quick and no time option to register thim/herself. + + ![enter image description here](https://apidocs.lrcontent.com/images/B_73485dee2d86350485.84999230.png "enter image title here") + + +- **Boost customer retention** : LoginRadius makes sure to keep people coming back with a delightful experience. When your digital services are useful and smoothly enbedded, people will have no reason to look elsewhere. + + ![enter image description here](https://apidocs.lrcontent.com/images/C_218675dee2c35402ba1.02287365.png "enter image title here") + +- **Increase upselling and cross-selling** : LoginRadius brings in more revenue with a personalized experience to the customers. When you know people’s preferences, you can offer what they want, when they want it, how they want it. + + ![enter image description here](https://apidocs.lrcontent.com/images/f8144bec-9ab6-4909-a036-d305e2e5a8b0_117215dee2bb4b78c31.04010604.png "enter image title here") + +- **Ideal customer journey** : Starting from the first step of onboarding to the thousandth login, we create a process that is welcoming and intelligent to foster great customer relationships. + + ![enter image description here](https://apidocs.lrcontent.com/images/CJ_309765dee3254cde3c9.96222836.png "enter image title here") +- **Localization** : LoginRadius supports every available human language, so all of your registration forms, emails, and texts can be customized for your worldwide market + + ![enter image description here](https://apidocs.lrcontent.com/images/L_206805dee32d6c9c0f9.21361621.png "enter image title here") + +- **Deliver a high-performance experience** : We never allow a customer go away because our login service is down. LoginRadius has unmatched uptime, and we can handle 150K logins per second—that’s 20x more than our competitors. + + ![enter image description here](https://apidocs.lrcontent.com/images/HP_15925dee344a944c73.10839663.png "enter image title here") + + If you and your organization are ready to experience the above explained user experience book a demo now. Click below + + [![enter image description here](https://apidocs.lrcontent.com/images/download_84705dee34c575d686.60372904.png "enter image title here")](https://www.loginradius.com/book-a-demo/) + + + + + + + + + + + + + + +