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#

  1. Generate connection/project files (without credentials):

    1
    
    ./geoserver-cli qgis export connections -w my_workspace -o connections.xml
  2. Import into QGIS:

    • Browser → WMS/WFS → New Connection → Import → select connections.xml
    • Enter credentials when prompted
  3. 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:

  1. Open QGIS Auth Manager: SettingsOptionsAuthentication (or Ctrl+Shift+A)
  2. Click Add Authentication Configuration
  3. Select Basic authentication
  4. 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
  5. 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#

  1. Never use --include-credentials flag in production
  2. Set a master password for QGIS Auth Manager
  3. Rotate credentials regularly
  4. Use environment-specific configurations
  5. Restrict file permissions: chmod 600 connections.xml

Complete Guide#

For detailed instructions, troubleshooting, and advanced configuration, see the complete QGIS Authentication Guide.