OAuth2 Application Practice: Attempting to Integrate DingTalk Login with Directus

1. Project Overview The expected outcome of this small project is to allow Directus to support logging in with DingTalk accounts. After understanding the OAuth2 protocol (see the previous blog post, reference 1), we have enough knowledge to implement this. Directus natively supports GitHub login, so the approach is to start with GitHub. Follow these steps: Configure Directus to use GitHub account login to get familiar with Directus’s standard OAuth support Configure Directus to use DingTalk account login; since DingTalk’s protocol implementation differs from RFC6749/GitHub, we may need to handle issues as they arise Deploy Directus to the server environment and verify on both DingTalk PC and mobile versions 2. Environment Configuration Use ngrok locally to expose a service to receive OAuth server redirects. ...

February 27, 2022 · 11 min

OAuth2 Protocol Analysis: GitHub and DingTalk Examples

1. Principle Suppose there’s an APP that wants me to use GitHub for authorized login. In this login scenario: I, as the data owner, tell the system (GitHub) that I agree to authorize a third-party application (App) to enter the system and obtain certain data (my ID, avatar, etc.). The system then generates a short-term access token to replace the password for the third-party application (APP) to access the data. ...

February 26, 2022 · 14 min