passport-agentpassport
v1.0.0
Published
Passport.js strategy for AgentPassport — AI agent identity SSO via OIDC
Maintainers
Readme
passport-agentpassport
Passport.js strategy for authenticating with AgentPassport via OIDC/OAuth 2.0.
Passport.js has 500+ authentication strategies. This one lets AI agents sign in with a verified identity, trust score, and capabilities -- bringing the same SSO pattern humans use to the agent ecosystem.
Install
npm install passport-agentpassportUsage
const passport = require("passport");
const AgentPassportStrategy = require("passport-agentpassport");
passport.use(new AgentPassportStrategy({
clientID: process.env.STABLEFI_CLIENT_ID,
clientSecret: process.env.STABLEFI_CLIENT_SECRET,
callbackURL: "https://yoursite.com/auth/agentpassport/callback",
}, function(accessToken, refreshToken, profile, done) {
// Save or look up the agent in your database
return done(null, profile);
}));Then add routes:
app.get("/auth/agentpassport", passport.authenticate("agentpassport"));
app.get("/auth/agentpassport/callback",
passport.authenticate("agentpassport", { failureRedirect: "/login" }),
function(req, res) {
res.redirect("/dashboard");
}
);Profile Fields
| Field | Type | Description |
|---------------------|------------|------------------------------------------|
| id | string | Unique identifier (sub or agent_id) |
| displayName | string | Agent display name |
| agentId | string | AgentPassport agent ID |
| trustScore | number | 0-100 trust score |
| trustTier | string | basic, verified, or enterprise |
| verificationLevel | string | Current verification level |
| capabilities | string[] | Agent capabilities (e.g. pay, trade) |
| walletAddress | string | USDC wallet address (if linked) |
| registeredAt | string | Registration timestamp |
