How to Use OAuth Authorization
About 436 wordsAbout 1 min
During development, you may need third-party tools such as IDE plugins, CI tools, and project management software for collaboration. OAuth authorization provides a secure way to connect your CNB account with these applications without exposing your login credentials.
Use Cases
Common third-party tools connect to CNB through OAuth authorization, for example:
- IDE plugins: Read code and review pull requests directly in the editor
- CI and project management tools: Read repositories, trigger builds, and sync task status
- Command-line tools: In particular CNB CLI, where one authorization grants long-term OpenAPI access
See CNB CLI for details.
Steps
1. Initiate Authorization Link
Authorization typically starts from within the third-party app: click "Connect CNB" or "Sign in with CNB", and the browser will redirect to the CNB authorization page.
2. Confirm Authorization
If not logged in to CNB, log in first. The authorization page shows the application name and requested permissions. Verify them, then click [Authorize].
3. Connection Successful
The page redirects back to the third-party app. The app now has permission to access your specified resources, and you can operate CNB resources (such as pulling code, viewing tasks) directly without logging in again.
FAQ
1. Is my information secure?
Very secure:
- Credential Isolation: OAuth's core design protects account security. Third-party apps can never access your CNB login credentials
- Temporary Tokens: The system issues encrypted access tokens with an expiration time, valid only for the authorized app
- Security Monitoring: The CNB Security Center audits token usage and immediately intercepts any anomalies
2. What permissions are authorized?
Before clicking "Authorize", you can view the full permission list on the authorization page.
Permissions are typically divided into the following categories:
- Basic Info: Read your avatar and nickname (usually to display the current user).
- Read-Only: The app can only view code or tasks but cannot modify them.
- Read/Write: The app can modify code, create tasks, or trigger builds.
3. How to Revoke OAuth Authorization?
You can revoke authorization at any time — the action takes effect immediately:
- Log in to CNB, click your avatar in the top right corner, and select [Settings]
- Find [Authorized Applications] in the left navigation
- Find the application in the list, click [Details], then click [Revoke All Access]
Once revoked, the application can no longer access any of your data until you authorize it again.