0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-23 20:33:16 -05:00
logto/packages/connector-alipay
2022-07-07 16:40:33 +00:00
..
docs chore(connector): update Alipay configTemplates for better demonstration (#1392) 2022-07-04 11:37:46 +08:00
src chore(connector): update connectors description (#1397) 2022-07-04 04:20:28 +00:00
CHANGELOG.md release: v1.0.0-alpha.3 2022-07-07 16:40:33 +00:00
jest.config.ts refactor: use @silverhand/jest-config (#861) 2022-05-17 17:32:41 +08:00
logo.svg feat(core): serve connector logo (#931) 2022-05-24 13:54:37 +08:00
package.json release: v1.0.0-alpha.3 2022-07-07 16:40:33 +00:00
README.md docs(connector-github): add GitHub README.md (en-US) (#1258) 2022-06-28 13:27:03 +00:00
tsconfig.base.json feat(core): wrap alipay web connector (#643) 2022-04-26 01:57:32 +00:00
tsconfig.build.json feat(core): wrap alipay web connector (#643) 2022-04-26 01:57:32 +00:00
tsconfig.json feat(core): wrap alipay web connector (#643) 2022-04-26 01:57:32 +00:00
tsconfig.test.json test: allow JS in tests (#903) 2022-05-20 13:02:36 +08:00

Alipay Web

Alipay Web connector is designed for desktop Web applications. It takes advantage of Alipay's OAuth 2.0 authentication workflow and enables Alipay users to sign in to other Apps using public Alipay user profiles without going through a troublesome register process.

Register Alipay developer account

Register an Alipay developer account if you don't have one.

Create and configure Alipay app

  1. Sign in to the Alipay console with the account you have just registered.
  2. Go to Web & Mobile Apps tab in My Application panel.
  3. Click Create an App button to start configuring your application.
  4. Name your application in Application Name following the naming conventions and upload your Application Icon, make sure you choose web application as App type.
  5. After finishing creating the application, we come to the Overview page, where we should click add ability to add Third-party application authorization, Get member information and App Alipay login before enabling Alipay sign-in.
  6. Go to Alipay Customer Center, and sign in with the Alipay developer account. Click Account Center on the top bar and go to APPID binding, whose entrance can be found at the bottom of the sidebar. Add binding by type in the APPID of the web application you just created in step 4. After finishing this step, you are expected to find abilities you have just added in step 5 kicks in.
  7. Come back to Alipay open platform console page, and you can find Interface signing method in development information section. Click set up button, and you can find yourself on a page setting signing method. Public Key is the preferred signing mode, and fill in contents from the public key file you have generated in the text input box.
  8. Set up Authorization Redirect URI by clicking set up button on the bottom of the Alipay console page. ${your_logto_origin}/callback/alipay-web is the default redirect URI used in Logto core.
  9. After finishing all these steps, go back to the top right corner of Alipay console page, and click Submit for review. Once the review is approved, you are good to go with a smooth Alipay sign-in flow.

Set up the Logto Alipay Web connector settings

  1. In the Alipay console workspace go to My application panel and click Web & Mobile Apps tab, you can find APPID of all applications.
  2. In step 7 of the previous part, you have already generated a key pair including a private key and a public key.
  3. Fill out the Logto connector settings:
    • Fill out the appId field with APPID you've got from step 1.
    • Fill out the privateKey field with contents from the private key file mentioned in step 2. Remember to use '\n' to replace all newlines.
    • Fill out the signType filed with 'RSA2' due to the Public key signing mode we chose in step 7 of Create And Configure Alipay Apps.

Config types

Name Type Enum values
appId string N/A
privateKey string N/A
signType enum string 'RSA' | 'RSA2'

References