QGIS Authentication Setup#
This guide explains how to configure QGIS Authentication Manager to securely connect to password-protected GeoServer instances when using connection files and project files generated by geoserver-cli.
!!! note “Original Documentation” This is a summary. See QGIS_AUTH.md for the complete guide.
Quick Start#
Generate connection/project files (without credentials):
1./geoserver-cli qgis export connections -w my_workspace -o connections.xmlImport into QGIS:
- Browser → WMS/WFS → New Connection → Import → select
connections.xml - Enter credentials when prompted
- Browser → WMS/WFS → New Connection → Import → select
QGIS automatically creates an authentication configuration
Why Use QGIS Auth Manager?#
- Security: Credentials are encrypted, not stored in plain text
- Best Practice: Industry standard for managing GIS credentials
- Flexibility: Multiple users can share project files with their own credentials
Manual Configuration#
If automatic configuration doesn’t work:
- Open QGIS Auth Manager:
Settings→Options→Authentication(orCtrl+Shift+A) - Click Add Authentication Configuration
- Select Basic authentication
- Configure:
- Name: Descriptive name (e.g., “GeoServer Production”)
- Resource: GeoServer base URL (e.g.,
http://geoserver.example.com/geoserver) - Username: Your GeoServer username
- Password: Your GeoServer password
- Click OK
Troubleshooting#
QGIS Still Prompts for Credentials#
- Check Resource URL matches connection URL (case-sensitive)
- Verify using Basic authentication method
- Clear QGIS cache and reopen
Authentication Works in Browser but Not in Project#
- Check layer URLs match Resource URL in auth configuration
- Ensure project uses URLs that match your auth configuration
Security Best Practices#
- Never use
--include-credentialsflag in production - Set a master password for QGIS Auth Manager
- Rotate credentials regularly
- Use environment-specific configurations
- Restrict file permissions:
chmod 600 connections.xml
Complete Guide#
For detailed instructions, troubleshooting, and advanced configuration, see the complete QGIS Authentication Guide.