Configuration and Maintenance of Permissions
An application can only call authorized APIs. Permission configuration should derive the required scopes from business actions, and evaluate read, write, and high-risk operations separately.
Configuration Principles
- Apply per API: Confirm the required permissions from the specific API page, and do not use a permission with a similar name but a broader scope as a substitute.
- Separate read and write: Read-only sync tasks should not be granted permission to create, update, delete, or send.
- Split applications by responsibility: When the responsibilities of organization synchronization, email processing, and calendar automation differ significantly, use different applications and credentials.
- Test before rollout: Verify new write permissions on test accounts or within controlled organization scopes before moving to production.
Recommended Workflow
- List the APIs, resource scopes, and read/write actions that the application will execute.
- Record the required scopes on each API page, then merge and deduplicate.
- Have the application owner and email administrator review high-risk permissions.
- Update permissions in the application details and save.
- Re-acquire the access token and verify read-only, write, and exception paths.
- Record the reason for the change, operator, time, verification results, and rollback plan.
Changes and Revocation
- After a feature is decommissioned, promptly remove the corresponding permissions. Do not retain scopes that "might be used later".
- When the responsible person leaves, the system is migrated, or a secret is leaked, first rotate the credentials, then check permissions and access logs.
- For operations such as sending emails, deleting resources, batch modifications, and quarantine release, add business-side secondary confirmation and audit records.
- Periodically check the actual called APIs against the authorization list, and clean up permissions that have not been used for multiple consecutive cycles.
Common Issues
| Phenomenon | Check Item |
|---|---|
401 Unauthorized | Check if the token is missing or expired, and whether the Bearer prefix and server are correct. |
403 Forbidden | Check whether the current application has the permissions listed on the API page, and whether the token was re-acquired after updating permissions. |
| Test works, production fails | Check whether the two environments use different applications, region servers, or resource scopes. |
| Can read but cannot write | Check whether only read permissions were granted, and whether the target resource also requires administrator or object-level permissions. |
Source: Alibaba Mail User Manual, Alibaba Mail API Open Platform