For one of my apps, I added extra fields to auth to hold some Amazon AWS credentials for the logged in user.
This means that I can access the required API keys when logged in , but because it's part of the database, it doesn't get committed to source control.
For accessing external database legacy database in another app, my web2py app was using postgresql, but I needed to access some tables in a legacy Oracle database.
So, I stored the location and access credentials in a table in postgres, and used those when opening the DAL for the legacy Oracle system.
Interesting to see if there's a canonical or best way to do this. Environmental variables, config files, database tables, all have weaknesses if used to store credentials.