pg_auth0
is a PostgreSQL extension that integrates Auth0's Management API directly into your PostgreSQL database. This allows you to manage Auth0 resources such as users, roles, and permissions using SQL queries within your database environment.
- Seamless Integration: Execute Auth0 Management API operations directly from PostgreSQL.
- Simplified Management: Manage Auth0 entities like users and roles using familiar SQL commands.
- Enhanced Security: Leverage PostgreSQL's security features to control access to Auth0 management functions.
Before installing pg_auth0
, ensure you have the following:
- PostgreSQL 9.6 or higher
- Auth0 account with Management API access
- Auth0 Management API token
-
Clone the Repository:
git clone https://github.com/brunoenten/pg_auth0.git
-
Navigate to the Directory:
cd pg_auth0
-
Build and Install the Extension:
make sudo make install
-
Load the Extension in PostgreSQL:
CREATE EXTENSION auth0;
After installation, configure the extension to communicate with the Auth0 Management API:
-
Set Auth0 Domain and Token:
SELECT auth0.set_domain('your-auth0-domain'); SELECT auth0.set_token('your-auth0-management-api-token');
Replace
'your-auth0-domain'
with your Auth0 domain (e.g.,example.auth0.com
) and'your-auth0-management-api-token'
with your Auth0 Management API token.
Once configured, you can perform various Auth0 Management API operations. For example, to retrieve a list of users:
SELECT * FROM auth0.get_users();
This will return a set of users from your Auth0 tenant.
Contributions are welcome! Please fork the repository and submit a pull request with your enhancements or bug fixes.
This project is licensed under the GPL-3.0 License. See the LICENSE.txt file for details.
Special thanks to the Auth0 team for their comprehensive authentication and authorization platform.
Note: This extension is a community-driven project and is not officially supported by Auth0.