Wiring up social login usually means creating an OAuth app for every provider, storing a separate set of keys, and maintaining a different flow for each one. Login with Astrina collapses all of that into a single integration.
One integration, every provider
Login with Astrina is a social single sign-on broker. You add it once, and your users can sign in with any of the supported providers:
- Yandex
- Telegram
- VK
The providers are configured once on Astrina, and every site in the ecosystem reuses them. There are no per-site OAuth apps to create, no client IDs to register with each provider, and nothing to re-do when you launch your next project. You integrate with Astrina, and Astrina handles the rest.
Direct buttons, no chooser page
The buttons on your site go straight to the provider. When a user clicks Google, they land directly in Google's own login through a transparent redirect via Astrina — there is no second chooser page in between.
Because the sign-in is brokered, a "Secured by Astrina ID" note is shown so users understand that Astrina handles the authentication. Users get the familiar provider screen they expect, and the trust cue that tells them who is in the loop.
A drop-in PHP SDK
Integration is a single file, sdk.php, with two calls that do the work:
AstrinaID::loginUrl()builds the URL for a login button.AstrinaID::handleCallback()exchanges the authorization code on your server and returns the identity.
The identity you get back includes a stable, opaque sub, plus the provider, email, name, and avatar.
Key your local accounts on (provider, sub) — not on email. The
subis stable and opaque, so it stays consistent even if a user changes the email on their provider account.
Secure by design
The flow follows OAuth2 / OIDC conventions and is hardened at every step:
- Single-use authorization codes that expire in 5 minutes.
- CSRF protection via a
statecheck on every request. - An id_token — a JWT signed with HS256 using your own client secret.
- The code-for-identity exchange happens server-to-server, so the sensitive step never runs in the browser.
You get a modern, standards-shaped login flow without having to assemble and audit each piece yourself.
How to get started
Drop sdk.php into your project and add a button that sends the user directly into a provider:
require 'sdk.php';
// Build a direct-to-provider button URL:
$url = AstrinaID::loginUrl('google');
echo '<a href="' . $url . '">Continue with Google</a>';
On your callback page, exchange the code server-side and read the identity:
require 'sdk.php';
$identity = AstrinaID::handleCallback();
// $identity['sub'], $identity['provider'],
// $identity['email'], $identity['name'], $identity['avatar']
// Look up or create the local account keyed on (provider, sub):
$user = find_or_create_user(
$identity['provider'],
$identity['sub']
);
That is the whole integration: one file, one button call, one callback call, and accounts keyed on (provider, sub).
One integration, every provider, secured by Astrina ID — add social login to your site and move on to building the rest of your product.
The core counter is free. Add your site and explore every feature.
What this page answers
- auth
- auth guide
- Add social login to your site with one integration
- Add social login to your site with one integration guide
- Add social login to your site with one integration explained
- Add social login to your site with one integration tutorial
- getting started with Add social login to your site with one integration
- Add social login to your site with one integration best practices
- Add social login to your site with one integration step by step
- what is Add social login to your site with one integration
- Add social login to your site with one integration for beginners
- Add social login to your site with one integration checklist
- Add social login to your site with one integration examples
- why Add social login to your site with one integration matters