Photo and Drive Service (PDS) Developer Edition allows users to log on to PDS by using DingTalk to scan a QR code. If you want to allow users to log on to PDS in this way, you must enable logon with DingTalk. This topic describes how to enable logon with DingTalk in the PDS console.
Prerequisites
You have the permissions to perform operations in the PDS console. If a Resource Access Management (RAM) user is used, the AliyunPDSFullAccess permission must be granted to the RAM user. For more information, see Grant permissions to a RAM user.
A PDS Developer Edition domain is created. If no PDS domain is available, create a PDS Developer Edition domain first. For more information, see Example of building a cloud disk service.
You have the permissions of an enterprise internal developer for DingTalk. If you are not a DingTalk developer, apply for the role first. For more information, see Become a DingTalk developer.
Procedure
Step 1: Create an internal application in DingTalk
Log on to the DingTalk Open Platform by using your developer account.
In the top navigation bar, click Application Development.
On the DingTalk Applications page, click Create Application, enter the application information, and then click Save.
You are navigated to the details page of the DingTalk application.
Step 2: Configure a redirect URL and grant permissions to the application
Configure the Redirect URL (Callback Domain) parameter.
In the left-side navigation pane of the DingTalk application details page, click Development Configuration. Configure the Redirect URL (Callback Domain) parameter in the Security Settings section.
The redirect URL must be in the
https://{domainId}.api.aliyunpds.com/v2/oauth/callback
format.If you have enabled and configured a domain name for logon authentication, the redirect URL must be in the
https://www.example.com/v2/oauth/callback
format.If you have enabled domain name for logon authentication but no domain name is configured, the redirect URL must be in the
https://{domainId}.auth.aliyunpds.com/v2/oauth/callback
format.If you use a domain that is created before March 2, 2023, the redirect URL must be in the
https://{domainId}.auth.aliyunpds.com/v2/oauth/callback
format.
Grant the read permissions on member information to the application.
In the left-side navigation pane of the DingTalk application details page, choose Development Configuration > Permissions.
On the Permissions page, search for Member information read permission and click Apply.
Release the DingTalk application.
In the left-side navigation pane of the DingTalk application details page, choose Application Release > Version Management and Release.
On the page that appears, click Create Version. In the Create Version dialog box, configure the Version, Description, and Application Available Range parameters and click Save.
Click Release.
Step 3: Enable logon with DingTalk
Obtain the client ID and client secret of the DingTalk application.
In the left-side navigation pane of the DingTalk application details page, choose Basic Information > Credentials and Basic Information.
Save the client ID and client secret in the Application Credentials section.
Enable logon to PDS Developer Edition with DingTalk.
Log on to the PDS console. In the left-side navigation pane, choose Photo and Drive Service (Developer Edition) > Domains.
Find the domain for which you want to enable logon with DingTalk and click Details in the Actions column.
On the domain details page, click the User Systems tab and click Configure next to the Access from OAuth 2.0 Logon Page of PDS parameter. The Configure PDS Logon Page panel appears.
Turn on Enable Logon by DingTalk, enter the client ID and client secret obtained in the previous step for the AppID and AppSecret parameters, and then click OK.
Step 4: Log on to PDS with DingTalk
When you log on to the PDS console from a browser, the DingTalk login option appears below Other Login Mode.
Click ding login. The DingTalk QR code appears. Scan the QR code to log on.