osec Auth: Passwordless logins: email code, Google and Apple
Add sign-in to any site or app without storing a single password, and without setting up Google or Apple OAuth yourself.
What it does
- Email one-time code, Google and Apple sign-in in one dialog
- No OAuth apps, keys or consent screens to configure
- Templates for HTML, React, React Native, WordPress, Wix, Squarespace
- Validate every API call against the session
What goes in, what comes out
- What goes in
- Your project's appcode in the widget, then the visitor's email address (or a click on Google or Apple).
- What comes out
- A signed-in session cookie in the browser and a login event with the email. Your server posts the session to api2.osec.one/validate and gets the user's id and email, or 401.
- Example
- curl -X POST https://api2.osec.one/validate -H "appcode: YOUR_APPCODE" --cookie "session=TOKEN_FROM_THE_BROWSER"
- Limits
- Sign-in is not counted against the daily request quota. Code requests are rate-limited per IP address. Google and Apple consent screens show osec.one as the app name.
How to set it up
- Console → Projects → Add project. Enter your site's domain.
- Open Auth config → pick email code, Google and/or Apple.
- Paste the widget, using your project's appcode.
- Open the dialog from any button. Listen for the login event.
- On your API, validate the session token before trusting a request.
html
<script>
window.OSEC_ONE_AUTH_CONFIG = { appcode: "YOUR_APPCODE" };
</script>
<script src="https://osec.one/assets/osec-auth/osec_one_auth.js"></script>
<button onclick="window.osec_one_auth.open()">Sign in</button>
<script>
window.addEventListener("osec_one:login:success", (e) => {
console.log("signed in as", e.detail.email); // session cookie is set
});
</script>bash: validate a session on your server
curl -X POST https://api2.osec.one/validate \
-H "appcode: YOUR_APPCODE" \
--cookie "session=TOKEN_FROM_THE_BROWSER"
# 200 {"user_uuid": "...", "user_email": "..."} or 401Good to know
- Templates for React, React Native, WordPress, Wix and Squarespace are in the console (Auth config → Code blocks).
- Google and Apple consent screens show "osec.one" as the app name.