Authentication
Connect Power Platform Tool Box to your Dataverse environments securely. This guide covers all authentication methods, security features, and best practices.
Authentication Methods
Power Platform Tool Box supports three authentication methods for connecting to Dataverse environments:
Interactive Login (Recommended)
Best for: End users, interactive scenarios, MFA-enabled accounts
Interactive login uses Microsoft's OAuth 2.0 flow with the Microsoft Authentication Library (MSAL):
- User initiates connection
- Browser opens Microsoft login page
- User authenticates (supports MFA, Conditional Access)
- Consent is granted to PPTB
- Access and refresh tokens are securely stored
Benefits:
- Most secure method
- Supports Multi-Factor Authentication (MFA)
- Supports Conditional Access policies
- No need to handle credentials
- Automatic token refresh
Setup:
Environment URL: https://org.crm.dynamics.com
Auth Method: Interactive Login
Interactive login is the recommended method for most users. It provides the highest security and best user experience.
OAuth App Registration
Best for: Automation, service principals, CI/CD pipelines, background processes
Use an Azure AD application registration with client credentials:
Prerequisites:
-
Register app in Azure AD:
- Go to Azure Portal → Azure Active Directory → App registrations
- Click "New registration"
- Name:
PowerPlatformToolBox - Supported account types: Choose appropriate option
- Redirect URI: Leave blank
-
Configure API permissions:
- Add "Dynamics CRM" → "user_impersonation"
- Grant admin consent
-
Create client secret:
- Go to Certificates & secrets
- New client secret
- Copy the secret value immediately
Setup:
Environment URL: https://org.crm.dynamics.com
Auth Method: OAuth (Client Secret)
Client ID: 00000000-0000-0000-0000-000000000000
Client Secret: your-secret-value
Tenant ID: 00000000-0000-0000-0000-000000000000
Benefits:
- Suitable for automation
- No interactive prompts
- Service principal support
- Fine-grained permissions
Store client secrets securely. Never commit them to source control or share them publicly.
Username/Password
Best for: Development, testing, POC scenarios
Not recommended for production use. This method:
- Cannot bypass MFA
- Does not support Conditional Access
- Requires storing credentials
- May violate security policies
Direct authentication with username and password:
Setup:
Environment URL: https://org.crm.dynamics.com
Auth Method: Username/Password
Username: user@domain.com
Password: your-password
Use this method only for:
- Local development environments
- Testing and proof-of-concepts
- Environments without MFA requirements
Security Features
Encrypted Storage
All sensitive credentials are encrypted using OS-native secure storage:
- macOS: Keychain
- Windows: DPAPI (Data Protection API)
- Linux: libsecret
Encrypted fields:
- Client ID
- Client Secret
- Access Token
- Refresh Token
- Password
Automatic Migration
If you're upgrading from an older version:
- Plain-text connections are automatically encrypted on first launch
- No manual intervention required
- Backwards compatible
Token Management
- Access tokens automatically refreshed before expiration
- Refresh tokens securely stored and rotated
- Failed refresh triggers re-authentication
- No plaintext token storage
Managing Connections
Add Connection
- Click "Add Connection" button
- Fill in connection details
- Select authentication method
- Click "Connect"
- Complete authentication flow
Edit Connection
- Right-click connection in list
- Select "Edit"
- Modify details (name, URL, etc.)
- Re-authenticate if changing credentials
Delete Connection
- Right-click connection in list
- Select "Delete"
- Confirm deletion
- Encrypted credentials are securely removed
Set Active Connection
- Click on a connection in the list
- Connection becomes active
- Tools use the active connection
- Active connection highlighted in UI
Troubleshooting
Connection Failed
Symptom: "Failed to connect" error
Solutions:
- Verify environment URL is correct
- Check network connectivity
- Ensure credentials are valid
- Verify app registration permissions (OAuth)
- Check MFA/Conditional Access policies
Token Expired
Symptom: "Unauthorized" or "Token expired" error
Solutions:
- PPTB automatically refreshes tokens
- If refresh fails, re-authenticate
- Check refresh token is not revoked
- Verify app registration is not disabled
MFA Required
Symptom: "MFA required" error with username/password
Solution:
- Use Interactive Login instead
- Username/password cannot bypass MFA
- Configure OAuth app registration for automation
Insufficient Permissions
Symptom: "Access denied" or "Insufficient privileges"
Solutions:
- Verify user has necessary security roles in Dataverse
- Check app registration API permissions (OAuth)
- Ensure admin consent granted for app permissions
- Review Dataverse security settings
Best Practices
For End Users
- Use Interactive Login
- Enable MFA on your account
- Don't share connections
- Review active connections regularly
For Developers
- Use OAuth for automation
- Rotate client secrets regularly
- Use service principals for CI/CD
- Never commit credentials to code
For Administrators
- Enforce MFA policies
- Use Conditional Access
- Review app registrations
- Audit connection usage