Your agent can build the integration.See the two prompts
Documentation navigation

Login result

Fetch the clean-callback result from your backend using the original session key, client credentials and callback. Pending reads do not consume the session. A succeeded result carries profile; a failed result carries error. Terminal results are consumed atomically once; expiry, replay and invalid sessions return 400. Verify the initiating browser cookie before calling. No automatic retries after ambiguous failure.

On this page
POSThttps://api.anyoauth.com/v1/login/result

Authentication: Client ID and secret in JSON; confidential backend only.

Request

Content type: application/json.

FieldTypeRequiredDescription and constraints
client_idstringYesminLength: 1; maxLength: 100
client_secretstringYesminLength: 1; maxLength: 200
session_keystringYespattern: ^[A-Za-z0-9_-]{43}$
redirect_uristringYesExact registered HTTPS URL or HTTP loopback; no credentials, query or fragment. maxLength: 2048; format: uri; x-validation: redirect
Illustrative JSON request
{
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"session_key": "sssssssssssssssssssssssssssssssssssssssssss",
"redirect_uri": "https://your-app.example/auth/callback"
}

SDK and HTTP examples

Most apps mount the managed router below. Browser startLogin('google'), getProfile() and logout() use it; cookies and callbacks are automatic. Quickstart · Frontend frameworks.

Backend
import { createAuth } from "@anyoauth/node/express";

const auth = createAuth({
clientId: process.env.ANYOAUTH_CLIENT_ID,
clientSecret: process.env.ANYOAUTH_CLIENT_SECRET,
origin: "http://localhost:3000",
});

app.use("/auth", auth.router());

npm install @anyoauth/nodeManaged backend routerCurrent source example · published 0.1.0 predates these helpers

Custom SDK method: completeLogin

Use this method when you own the routes or storage. Custom integration.

complete Login
import { AnyOAuth } from "@anyoauth/node";

const client = new AnyOAuth({
clientId: process.env.ANYOAUTH_CLIENT_ID ?? "YOUR_CLIENT_ID",
clientSecret: process.env.ANYOAUTH_CLIENT_SECRET ?? "YOUR_CLIENT_SECRET",
baseUrl: process.env.ANYOAUTH_API_ORIGIN ?? "https://api.anyoauth.com",
});

// Inside your callback route: session is the initiating browser's server-side session.
// pendingLogin is the loginAttempt you saved before redirecting. Reject a missing session/attempt.
const result = await client.completeLogin({
loginAttempt: session.pendingLogin
});

npm install @anyoauth/nodeConfidential backend SDKCurrent source example · published 0.1.0 predates these helpers

Underlying HTTP and compatibility-method examples
Login result
import { AnyOAuth } from "@anyoauth/node";

const client = new AnyOAuth({
clientId: process.env.ANYOAUTH_CLIENT_ID ?? "YOUR_CLIENT_ID",
clientSecret: process.env.ANYOAUTH_CLIENT_SECRET ?? "YOUR_CLIENT_SECRET",
baseUrl: process.env.ANYOAUTH_API_ORIGIN ?? "https://api.anyoauth.com",
});

const result = await client.loginResult({
sessionKey: process.env.ANYOAUTH_SESSION_KEY ?? "sssssssssssssssssssssssssssssssssssssssssss",
redirectUri: process.env.ANYOAUTH_REDIRECT_URI ?? "https://your-app.example/auth/callback"
});

npm install @anyoauth/nodeConfidential backend SDKCurrent source example · published 0.1.0 predates these helpers

Input bindings in method references are illustrative. Callback routes load saved login attempts from the initiating browser's server session. Browser/mobile SDKs use their backend for confidential operations.

Response

Success status: 200.

FieldTypeRequiredDescription and constraints
status"pending" | "succeeded" | "failed"Yes
profileobjectNo
profile.subjectstringYes
profile.provider"google" | "github" | "email"Yes
profile.providerSubjectstringYes
profile.namestring | nullYes
profile.usernamestring | nullYes
profile.emailstring | nullYes
profile.emailVerifiedbooleanYes
profile.avatarUrlstring | nullYes
error"access_denied" | "invalid_provider_response" | "provider_unavailable"No
Illustrative JSON response
{
"status": "succeeded",
"profile": {
"subject": "usr_example",
"provider": "google",
"providerSubject": "provider-subject",
"name": null,
"username": null,
"email": null,
"emailVerified": false,
"avatarUrl": null
}
}

Errors

Application errors use the shared error model. Infrastructure may return non-JSON responses; SDKs expose structured transport/protocol errors. Do not automatically retry a one-time code exchange.

FieldTypeRequiredDescription and constraints
errorstringYes
messagestringNo
Illustrative error response
{
"error": "request_failed",
"message": "The request could not be completed."
}

Contract source

This page, its field tables and sample inputs derive from OpenAPI version 0.2.0. Download OpenAPI · HTTP and SDK model schemas · SDK method contracts · Request schema · Response schema