
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
dgp-oauth2
Advanced tools
A generic OAuth2 authentication service and user permission manager.
Based off OpenSpending auth service.
make install
make test
python server.py
PRIVATE_KEY & PUBLIC_KEY an RSA key-pair in PEM format.
See tools/generate_key_pair.sh for more info.GOOGLE_KEY & GOOGLE_SECRET: OAuth credentials for authenticating with GoogleGITHUB_KEY & GITHUB_SECRET: OAuth credentials for authenticating with GithubDATABASE_URL: A SQLAlchemy compatible database connection string (where user data is stored)EXTERNAL_ADDRESS: The hostname where this service is located onALLOWED_SERVICES:
Which permissions providers are available. A ; delimited list of provider identifiers.
Each provider identifier takes the form of [alias:]provider, where provider is the name of a Python module
which exports a get_permissions(service, userid) function.INSTALLED_EXTENSIONS:
List of installed extensions. A ; delimited list of extension - the name of a Python modules which exports one or all of these functions
on_new_user(user_info)on_user_login(user_info)on_user_logout(user_info)/auth/check
Method: GET
Query Parameters:
jwt - authentication tokennext - URL to redirect to when finished authenticationReturns:
If authenticated:
{
"authenticated": true,
"profile": {
"id": "<user-id>",
"name": "<user-name>",
"email": "<user-email>",
"avatar_url": "<url-for-user's-profile-photo>",
"idhash": "<unique-id-of-the-user>",
"username": "<user-selected-id>" # If user has a username
}
}
If not:
{
"authenticated": false,
"providers": {
"google": {
"url": "<url-for-logging-in-with-the-Google-provider>"
},
"github": {
"url": "<url-for-logging-in-with-the-Github-provider>"
},
}
}
When the authentication flow is finished, the caller will be redirected to the next URL with an extra query parameter
jwt which contains the authentication token. The caller should cache this token for further interactions with the API.
/auth/authorize
Method: GET
Query Parameters:
jwt - user token (received from /user/check)service - the relevant service (e.g. storage-service)Returns:
{
"token": "<token-for-the-relevant-service>"
"userid": "<unique-id-of-the-user>",
"permissions": {
"permission-x": true,
"permission-y": false
},
"service": "<relevant-service>"
}
/auth/update
Method: POST
Query Parameters:
jwt - authentication token (received from /user/check)username - A new username for the user profile (this action is only allowed once)Returns:
{
"success": true,
"error": "<error-message-if-applicable>"
}
Note: trying to update other user profile fields like email will fail silently and return
{
"success": true
}
/auth/public-key
Method: GET
Returns:
The service's public key in PEM format.
Can be used by services to validate that the permission token is authentic.
FAQs
{{ DESCRIPTION }}
We found that dgp-oauth2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.