Authentication Commands
RAPS🌼RAPSRust CLI for Autodesk Platform Services.View in glossary supports both 2-legged (client credentials🤖2-legged authServer-to-server authentication without user context.View in glossary) and 3-legged (authorization code👤3-legged authUser-authorized authentication with browser login.View in glossary) OAuth🔐OAuthIndustry-standard authorization protocol used by APS.View in glossary flows.
Commands Overview
| Command▶️CommandInstruction executed by a CLI tool.View in glossary | Description |
|---|---|
raps auth test | Test 2-legged OAuth credentials |
raps auth login | Login with 3-legged OAuth |
raps auth logout | Clear stored tokens |
raps auth status | Show authentication status |
raps auth whoami | Show user profile👤ProfileNamed set of configuration settings.View in glossary |
raps auth inspect-token | Inspect token🎟️TokenCredential for API authentication.View in glossary details |
raps auth test
Test 2-legged OAuth authentication using your Client ID and Client Secret🔒SecretEncrypted sensitive configuration value.View in glossary.
$ raps auth test
✓ Authentication successful!
Token expires in: 3599 seconds
Requirements:
APS_CLIENT_IDenvironment variable🌍Environment VariableConfiguration value passed to applications.View in glossaryAPS_CLIENT_SECRETenvironment variable
raps auth login
Login with 3-legged OAuth. Supports multiple methods.
raps auth login [--default] [--device] [--token <token>]
Options:
--default: Use default scopes without prompting--device: Use device code flow (for headless/server environments)--token <token>: Provide access token directly (for CI/CD🔁CI/CDAutomated build, test, and deployment pipelines.View in glossary)
Browser-based login (default):
$ raps auth login
Opening browser for authentication...
Select scopes:
[x] data:read
[x] data:write
[x] data:create
[x] account:read
[x] user:read
[x] viewables:read
✓ Login successful!
User: john.doe@example.com
Device code flow (headless):
$ raps auth login --device
Device Code Authentication
──────────────────────────────────────────────────
User Code: ABC-123-DEF
Verification URL: https://developer.api.autodesk.com/authentication/v2/device
Please visit the URL above and enter the user code.
Waiting for authorization...
✓ Authorization successful!
Token-based login (CI/CD):
$ raps auth login --token "eyJhbGc..." --expires-in 3600
✓ Token validated for user: user@example.com
raps auth status
Show current authentication status.
$ raps auth status
Authentication Status
────────────────────────────────────────
2-legged (Client Credentials): ✓ Available
3-legged (User Login): ✓ Logged in
Token: abcd...wxyz
Expires in: 1h 30m
raps auth inspect-token
Inspect the current access token for scope, expiry, and metadata.
$ raps auth inspect-token
Token Information:
────────────────────────────────────────────────────────────
Valid: ✓ Yes
Expires At: 2024-01-15 15:30:00 UTC
Expires In: 45 minutes
Scopes:
• data:read
• data:write
• data:create
────────────────────────────────────────────────────────────
With expiry warning:
$ raps auth inspect-token --warn-expiry 3600
⚠ WARNING: Token expires in less than 1 hour!
Authentication Types
2-Legged OAuth (Client Credentials)
Used for server-to-server operations without user context.
Use for:
- Uploading files to OSS📦OSSAPS cloud storage for files and models.View in glossary
- Creating buckets
- Starting translations
- Managing webhooks🪝WebhooksEvent notifications sent to your application.View in glossary
- Design Automation🤖Design AutomationRun Autodesk desktop apps in the cloud.View in glossary
3-Legged OAuth (Authorization Code)
Used for operations requiring user context.
Use for:
- Accessing BIM 360🔵BIM 360Legacy Autodesk construction platform (predecessor to ACC).View in glossary/ACC🏗️ACCAutodesk's construction management platform.View in glossary hubs and projects
- Browsing folders and items
- Managing issues
- User-specific data
Token Management (v3.7.0+)
RAPS automatically:
- Stores tokens securely using OS keychain🔑KeychainSecure OS storage for credentials.View in glossary (default) or file storage
- Refreshes tokens when they expire
- Uses the appropriate token type for each operation
Secure Token Storage (Default):
- Windows: Windows Credential Manager
- macOS: macOS Keychain
- Linux: Secret Service (gnome-keyring, kwallet)
Fallback File Storage:
- Windows:
%APPDATA%\raps\tokens.json - macOS:
~/Library/Application Support/raps/tokens.json - Linux:
~/.local/share/raps/tokens.json
🔐 Security: Keychain storage encrypts tokens. File storage stores tokens in plaintext and should only be used in secure environments.
Troubleshooting
”Authentication failed” error
- Verify
APS_CLIENT_IDandAPS_CLIENT_SECRETare set correctly - Check your APS☁️APSAutodesk Platform Services - cloud APIs for CAD/BIM automation.View in glossary application is active in the Developer Portal
- Ensure credentials haven’t been rotated
”Callback URL mismatch” error
Verify APS_CALLBACK_URL matches your APS application configuration⚙️ConfigurationSettings controlling application behavior.View in glossary.
”Token expired” error
Try logging out and back in:
raps auth logout && raps auth login