Guides
Domains
Any number of domains: paste a list, add them from your server, cover subdomains with a wildcard, or let your server confirm new ones as people sign in.
Every sign-in ends on one of your platform’s domains, so loginos has to know them. A platform can have any number, and all of them share the same people: someone who joined on one domain is already a member on the others.
| How | When it fits |
|---|---|
| In the console | A few domains, or a list you paste once. |
| From your server | Your customers connect their own domains, and your code knows when. |
| A wildcard | Everything under a domain you own: *.example.com. |
| Automatically | Domains come and go, and loginos should ask your server the first time one is used. |
A domain is a host without a scheme or path: app.example.com, example.net, localhost:3001. loginos only sends people back to https://<one of your domains><callback path>, and plain http only on localhost and 127.0.0.1.
In the console
Open your platform’s Domains tab. Add one domain, or paste a list with one per line (commas and spaces work too). Search and pages keep long lists usable.
From your server
When one of your customers connects a domain, register it with the Management API:
curl -X POST https://loginos.io/api/v1/domains \
-u "YOUR_APP_KEY:YOUR_APP_SECRET" \
-H "content-type: application/json" \
-d '{"host": "shop.customer.example"}'Send {"hosts": [...]} to add up to 1,000 at once. Hosts that are already there are fine, so you can call it every time. When the customer leaves, DELETE /api/v1/domains/shop.customer.example.
Wildcards
*.example.com covers every subdomain of example.com, at any depth. You prove that you own example.com once, with a DNS record:
Type TXT
Name _loginos.example.com
Value loginos-verify=<the value the console or the API gives you>Then choose Check record in the console, or call POST /api/v1/domains/*.example.com/verify. Until the record is found, the wildcard matches nothing. A wildcard never covers example.com itself; add that separately if you use it.
Automatic domains
If your domains come and go, like your customers’ own domains or new brands, loginos can learn them as people sign in. You give loginos the address of an endpoint on your server, and loginos asks it the first time a sign-in arrives from a host that isn’t one of your domains yet.
Your domains
- lumen.app
- *.lumen.app
The question is one request:
POST https://api.example.com/loginos/domain-check
Content-Type: application/json
User-Agent: loginos-domain-check/1
{"host": "shop.customer.example", "client_id": "YOUR_APP_KEY"}Answer from your own records, within 3 seconds:
{ "host": "shop.customer.example", "allow": true }"allow": true adds the host to your domains, marked as automatic, and the sign-in goes on. Anything else stops the sign-in on a loginos page, as for any address you never registered: "allow": false, another host, another status, a redirect, or no answer in time.
Why loginos asks your server
Your app key is public: it is in the page source wherever your sign-in button is. A look-alike site on another domain can send people to loginos with it, so a sign-in that names your app proves nothing about where it came from. If loginos trusted it, people would sign in to your platform and be sent back, with their sign-in code, to the look-alike. Your server is the one place that knows which domains are yours.
Turn it on
- Add the endpoint to your server (examples below), or let your coding agent do it: the console’s Copy a prompt for your coding agent has everything it needs, and so does the prompt on Build with AI.
- In the console, open Domains, enter the endpoint’s address under Add new domains automatically and choose Turn on. The address has to be
httpson a public domain. - Before turning it on, loginos asks your endpoint about a domain that can’t exist, like
loginos-check-3f9a1c0b2e.invalid. The endpoint has to answer, and answer"allow": false. Otherwise the feature stays off, and the console tells you what came back. - Try a domain asks your endpoint about any domain without adding it.
// app/api/loginos/domain-check/route.ts
import { db } from "@/lib/db";
export async function POST(req: Request) {
const { host } = await req.json();
// Your own records: domains your customers connected, brands you run.
const domain = await db.customDomain.findUnique({ where: { host } });
return Response.json({ host, allow: domain?.status === "active" });
}Good to know
- Only exact hosts are added this way: never wildcards, IP addresses or
localhost. - The same check covers every way in: the redirect flow, pushed requests, the popup and the browser’s Continue as prompt. Sign-out returns only go to domains already on your list.
- loginos asks again about an automatic domain when it is used a day after the last yes. A clear
"allow": falseremoves it; no answer keeps it until the next time. So a domain a customer let go of stops working without you doing anything. - Domains on your list never cause a check, apart from that daily one. loginos sends one platform at most 120 checks a minute, and remembers a no for a minute.
- The console and the API mark these domains as automatic (
"automatic": true). Adding one by hand or withPOST /api/v1/domainsmakes it a regular domain. To stop one, answer no for it: if you only remove it, the next sign-in there adds it again. - With pushed requests, loginos asks while your server waits for
/oauth/par. A development server that handles one request at a time can’t answer itself; register its domain instead.