AliPay Integration
AliPay is a widely used third-party mobile and online payment platform in China. Integrating with LoginRadius allows users to log in using their AliPay identity. It enables the merchant to retrieve basic open information such as user ID, avatar, nickname, gender, province, and city.
Key Features
-
OAuth-based integration with AliPay for secure user login
-
Access to verified user profile information from AliPay
-
Easy setup via LoginRadius Admin Console
-
Support for web and mobile applications
-
Customizable social login icon
Use-Cases
-
Apps targeting users in China who prefer logging in with AliPay
-
Merchants providing personalized services based on user profiles
-
Businesses simplifying login and registration flows with familiar providers.
-
Organizations expanding into Chinese markets with localized identity option.s
Integration Guide
Alipay is a popular Chinese third-party mobile and online payment platform. Alipay users use their Alipay identity to log in to the merchant application securely, and the merchant can obtain basic open information (user ID, user avatar, nickname, gender, province, city, etc.) of Alipay users and provide corresponding open services.
AliPay App Configuration
This section provides information regarding AliPay account creation and verification. It also includes ID and bank details verification that you need to perform on AliPay’s official site.
- AliPay account creation
- Configuring ID details
- AliPay Verification
- Bank details configuration
- AliPay Application
This section explains how you can create an account on AliPay:
Step 1: If you already have created an account, ensure you have a verified AliPay account.
Step 2: To create a new account, you must configure the AliPay Login App on your computer.
Step 3: Click the Registration in the AliPay site .
Step 4: Select your desired country in the Country/Region field.
Step 5: Enter your mobile phone number in the Phone Number field.
Step 6: Click the Get verification code button to receive a verification code via text message on your phone.
Step 7: Enter the SMS code you received on your phone in the SMS verification Code field.
Step 8: Click the Next button to proceed.
This section explains how you can configure ID details while creating an AliPay account:
Step 1: Enter your password in the Login password field. Use numeric characters (0-9), special characters (e.g.!@#$%), upper case (A-Z) and lower case(a-z) letters.
Step 2: In the Payment password field, enter the payment password. Use only six numeric characters (0-9).
Step 3: Select the Security question and enter its answer in the Security Answer field. This will help you retrieve the password in case you forget it.
Step 4: In Your Identity, enter your personal information: First Name, Last Name, Gender.
Step 5: In Certificate, select your ID type, e.g., your driving license ID, passport ID, etc.
Step 6: In the ID Number field, enter your ID number.
Step 7: In the Validity field, enter the document's expiration date specified in the above field.
Step 8: In the Occupation field, enter your occupation type.
Step 9: In the Address in China field, enter your home address in China if you are from China; otherwise, select the Overseas option.
Step 10: Enter your home address in the field.
Step 11: Now click on the Submit button.
The following step is to complete the ID details form.
This section explains how to verify your AliPay account:
Step 1: After registration, login to your account from https://auth.alipay.com/login/index.htm.
Step 2: Once you are logged in, you need to verify your Alipay account from https://certify.alipay.com/choose.htm.
Step 1: In the Bank card number field, enter your bank card number (16-digit number on the front side of your card).
Step 2: In the Cardholder's Name field, enter the name specified on your card.
Step 3: In the Credentials section, select the ID type and specify your ID number in this field.
Step 4: Enter your mobile phone number in the Cellphone number field.
Step 5: Press the Next button to proceed.
This section explains how you can create an AliPay login application. Go to this page: https://openhome.alipay.com/platform/manageApp.htm and follow the below steps:
Step 1: Select the Create Application button to create the AliPay Application.
Step 2: To create your AliPay application, select the web or mobile application development option that best meets your requirements.
Step 3: Fill in the application's name. After you submit the form, a new page will open, showing the time it will take for your application to be approved (it can take up to a few days).
Step 4: Once your application has been approved, go to the Function information page, find the Quick Login option, and click the Subscribe button.
Configuration in LoginRadius Console
This section covers the configurations you must perform in the LoginRadius Console to implement AliPay as an OAuth Provider.
Step 1: Navigate to Authentication->Custom IDPs in the console.
Step 2: Click Add Custom IDP, select Custom OAuth Provider.
Step 3: In the Provider Name field, enter the unique name of the OAuth provider, as shown in the screen below.
Step 4: In the Extra Parameter In Redirect To Provider (Optional) field, enter any additional options (if any) supported by AliPay in addition to the default options.
Step 5: In the Customer Login Endpoint field, enter https://globalprod.alipay.com/login/global.htm.
Step 6: In the Access Token Endpoint field, enter https://open-na.alipay.com/api/alipay/intl/oauth/auth/applyToken.htm.
Step 7: In the Application Key field, enter your AliPay API Key.
Step 8: In the Application Secret field, enter your AliPay Secret.
Note: You can get more details about how to get AliPay’s API Key and Secret here.
Step 9: In the Response Type field, enter “code”.
Step 10: In the Request Token HTTP Method field, enter the HTTP method of Request Token “GET”.
Step 11: In the Access Token Parameter Name For Api Access field, enter ”applyToken”.
Step 12: The Header (optional) can be used for those providers that pass the Access Token in the header. Enter the Provider’s header name in Key and add any of the LoginRadius value from the following in the Value field:
- #accesstoken#
- #idtoken#
- #oauthsignature#
Step 13: Pass the Query parameters (optional) from the AliPay Provider in key and value pairs (if AliPay supports query parameters).
Step 14: Data Mapping - Enter field mappings between AliPay fields and LoginRadiu user profile properties.
- Select Field(Dropdown): Select the LoginRadius field name you want to map to the respective Doximity field.
- The profile Key: Enter the Doximity field name corresponding to the LoginRadius field name.
You can also map more fields (as per your requirements) by clicking on the Add Row button.
Notes:
- The LoginRadius ‘ID’ field is the unique identifier for each profile attached to a LoginRadius customer account. Refer to the LoginRadius Data structure document for more details. The mapping of the LoginRadius 'ID' field (Loginradius field) is required for the OAuth Provider. A user will not be able to register/login if the value for this mapping is missing in the OAuth Provider.
- To make this social login work, you need to map the only field which is the LoginRadius ID field to the AliPay unionid field (it’s mandatory).
Step 15: Now, click on the ADD button to add and save the settings.
Custom AliPay Social Login Icon
To customize the AliPay icon on your login screen, familiarize yourself with customizing your social provider icons here and follow the below steps:
-
Refer to the Custom OAuth Provider Icon Setup Guide.
-
Upload or link your preferred icon asset.
-
Update the login widget code to include the AliPay provider and your custom icon.
Best Practices
-
Verify your AliPay developer account before starting the configuration.
-
Always map the
unionid
field to the LoginRadiusID
. -
Test login flows with both IDX pages and your app.
-
Protect your AliPay keys and secrets.
-
Use custom branding to enhance user trust and experience.