Observed since 20 Oct, 21:31 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Automated authentication for web agents
AgentAuth is a Python package that helps automate web authentication by simulating human-like login behavior. It supports various authentication methods including:
pip install agentauth
from agentauth import AgentAuth, CredentialManager
# Add credentials to a new credential manager
credential_manager = CredentialManager()
credential_manager.load_credential({
"website": "https://www.example.com",
"username": "user@example.com",
"password": "user_password"
})
# Create an instance of AgentAuth with access to credentials
aa = AgentAuth(credential_manager=credential_manager)
# Authenticate to a website for a given username
cookies = await aa.auth("https://www.example.com", "user@example.com")
# User is logged in! 🎉
# Use cookies for authenticated agent actions... (see examples directory to see how)
ℹ️ You can pass a custom LLM to the AgentAuth constructor. OpenAI's gpt-4o is the default and requires an OPENAI_API_KEY environment variable.
Many websites require an email step to authenticate. This could be for a magic link or login code, or it could be for email-based two-factor authentication. AgentAuth supports connecting an email inbox to handle these cases.
aa = AgentAuth(
imap_server="imap.example.com",
imap_username="agent@example.com",
imap_password="agent_email_password"
)
cookies = await aa.auth("https://www.example.com", "agent@example.com")
from agentauth import AgentAuth, CredentialManager
# Create a new credential manager
credential_manager = CredentialManager()
# Load credentials from 1Password
credential_manager.load_1password(os.getenv("OP_SERVICE_ACCOUNT_TOKEN"))
# Load credentials from Bitwarden
credential_manager.load_bitwarden(
os.getenv("BW_CLIENT_ID"),
os.getenv("BW_CLIENT_SECRET"),
os.getenv("BW_MASTER_PASSWORD")
)
# Load credentials from a file
credential_manager.load_file("credentials.json")
# Load a single credential
credential_manager.load_credential({
"website": "https://www.example.com",
"username": os.getenv("USERNAME"),
"password": os.getenv("PASSWORD")
})
# Load a list of credentials
credential_manager.load_credentials([
{
"website": "https://www.example.com",
"username": os.getenv("EXAMPLE_USERNAME"),
"password": os.getenv("EXAMPLE_PASSWORD")
},
{
"website": "https://www.fakewebsite.com",
"username": os.getenv("FAKEWEBSITE_USERNAME"),
"password": os.getenv("FAKEWEBSITE_PASSWORD")
}
])
Contributions are welcome! Please feel free to submit a pull request.
This project is licensed under the MIT License.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.4.0 | 28 Feb 2025 | 8 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 21:31 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:e48d876b9277a8a1b187684c406acd7a0be8388846cc25d7140547b26eceb507