// auth and identity
Via APISSOJet email verification with pingutil
Enterprise SSO users arrive with corporate identities, but the same B2B app usually also accepts magic links or OTP, and that door lets in throwaway and personal addresses. SSOJet documents webhooks such as user.created but no hook that can stop a sign-up, so screen in your app: in the Auth.js signIn callback from SSOJet's Next.js quickstart, look up the address before the session is issued.
Where it connects: Your app's sign-in callback after the SSOJet OIDC login (Auth.js signIn callback), plus the user.created webhook
What goes wrong without it
- Our SSO customers are fine, but the magic-link fallback is where temp-mail trial accounts come from.
- We need to know which company a new user belongs to so we can map them to the right workspace, and the IdP profile does not always say.
- Personal Gmail accounts sign up for a product that only makes sense for teams, and sales chases them anyway.
What you can do with SSOJet and pingutil
Refuse throwaway addresses on non-SSO logins
Return false from signIn when verdict.is_spam is true. Auth.js redirects to its error page and no session is created.
Route work emails to the right workspace
category company versus free tells you whether the address belongs to an organization. Run a full lookup in the background for company.name and company.industry to suggest the matching workspace.
Clean up with the user.created webhook
SSOJet lists user.created as a webhook event. A background /v1/verify on new users flags dead mailboxes before onboarding emails go out.
Set it up
- 1
Follow SSOJet's Next.js quickstart to add the ssojet provider to Auth.js (NextAuth) with SSOJET_ISSUER, SSOJET_CLIENT_ID and SSOJET_CLIENT_SECRET.
- 2
Create a pingutil API key and add it as PINGUTIL_KEY.
- 3
Add the signIn callback below to the same NextAuth configuration.
- 4
Optionally add a webhook endpoint in the SSOJet dashboard subscribed to user.created for background mailbox checks.
- 5
Sign in through a magic-link or OTP connection with a disposable address and confirm you land on the error page.
// Add to the NextAuth config from SSOJet's Next.js quickstart.
async function lookup(email) {
try {
const res = await fetch('https://pingutil.com/v1/lookup', {
method: 'POST',
headers: {
authorization: 'Bearer ' + process.env.PINGUTIL_KEY,
'content-type': 'application/json',
},
body: JSON.stringify({ input: email, skip_enrichment: true }),
signal: AbortSignal.timeout(2000),
});
return res.ok ? await res.json() : null;
} catch {
return null; // fail open
}
}
export const authOptions = {
providers: [/* the ssojet provider from the quickstart */],
callbacks: {
async signIn({ user, account }) {
if (account?.provider !== 'ssojet' || !user.email) return true;
const data = await lookup(user.email);
if (!data) return true;
if (data.verdict.is_spam) return '/login?error=permanent_email_required';
// data.category is "company", "free", "isp", ...: persist it with the
// user in your database to route work emails to a workspace.
return true;
},
},
};What to do with each result
| pingutil result | Action in SSOJet |
|---|---|
| verdict.is_spam: true | Return a redirect string from signIn; no session is created |
| category: "company" | Allow; match the domain to an existing workspace or organization |
| category: "free" or "isp" | Allow as an individual user; keep them out of sales routing |
| Webhook /v1/verify status: "invalid" | Pause onboarding emails for that user |
| Timeout, 429 or 5xx | Return true (fail open) |
Limits to plan for
- SSOJet's event catalog lists notifications (user.created, dsync.user.created and others) but no synchronous hook that denies user creation, so the SSOJet user record exists even when your app refuses the session.
- signIn runs on every sign-in, and each lookup counts toward the 2,000 lookups a day (30,000 a month) per account. Skip the call for users you have already screened. Those are Free plan limits; Enterprise has custom limits.
- SSOJet notes webhook events can arrive out of order; deduplicate on event_id before acting on user.created.
SSOJet documentation
- ssojet.com/docs/en/sso/quickstart/fullstack/nextjs/
- ssojet.com/docs/en/events/event-types
- ssojet.com/docs/en/integrations/webhooks
SSOJet is a trademark of its owner. This integration uses SSOJet's documented extension points; it is not an official SSOJet app.
Common questions
- Do enterprise SSO users need to be checked at all?
- Rarely for disposable addresses, since their IdP vouches for them. The check matters most for magic-link, OTP and social logins on the same app, and the category is still useful for routing SSO users.
- Can I get the company name in the signIn callback?
- You can drop skip_enrichment to get the company profile, but first-seen domains take a few seconds. Do the full lookup in the background and keep the callback on fast mode.
Stop bad addresses in SSOJet today
Sign in with your email, create an API key and paste it into the step above. Test on a few real addresses first: the live demo shows exactly what your SSOJet setup will receive.