
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
OAuthManager is a Python package for managing API authentication using 1Password Service Accounts and securely caching credentials.
OP_SERVICE_ACCOUNT_TOKEN
).cryptography
Python packageInstall Python and Pip
Ensure you have Python 3.11 installed on your system. You can download it from python.org.
Install the OAuthManager package
You can install the OAuthManager package directly from PyPI:
pip install oauthmanager
To begin, sign up for a 1Password account. You will need to be on a 1Password Teams, Business, or Enterprise plan to create service accounts.
A service account allows OAuthManager to securely retrieve your API credentials. Follow the steps below to create one:
⚠️ Important: The service account token is shown only once during the creation process. Save it immediately in your 1Password account.
You will need to set two environment variables:
OP_SERVICE_ACCOUNT_TOKEN
: The service account token created in the previous step.OP_CACHE
: Enable caching for faster retrieval.Open your terminal.
Use the following command to open your .bashrc
, .bash_profile
, or .zshrc
(depending on your shell):
nano ~/.bashrc
Add the following lines to export your service account token and enable caching:
export OP_SERVICE_ACCOUNT_TOKEN="your-service-account-token"
export OP_CACHE="true"
Save the file and run:
source ~/.bashrc
Open the Command Prompt as Administrator.
Set the environment variables:
setx OP_SERVICE_ACCOUNT_TOKEN "your-service-account-token"
setx OP_CACHE "true"
This sets the variables globally. Restart the terminal for them to take effect.
Once you’ve installed OAuthManager and set up the necessary environment variables, you can start retrieving credentials from 1Password.
from oauthmanager import AuthManager, OnePasswordAuthManager
# Initialize the Auth Manager
auth_manager = OnePasswordAuthManager()
# Retrieve credentials for Spotify
spotify_creds = auth_manager.get_credentials("Spotify", "client_id", "client_secret", "uri")
# Use the credentials
print(f"Client ID: {spotify_creds['client_id']}")
print(f"Client Secret: {spotify_creds['client_secret']}")
print(f"Redirect URI: {spotify_creds['uri']}")
By default, the OAuthManager caches credentials locally using encryption. To refresh the cache, simply delete the credentials_cache.json
file, or let it expire after 24 hours.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A module for managing API authentication using 1Password and more.
We found that oauthmanager 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.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.