Sign in with Localoge
“Sign in with Localoge” is a button you add to your login screen. Your user clicks it, signs in with us, agrees to share their identity with you, and comes back to your product signed in. There is no extra password to create.
It is the same flow as Connecting a host, with the same /connect
link and the same code exchange. Only the scope changes.
What you receive
Section titled “What you receive”{ "success": true, "data": { "host_ref": null, "host_name": "Marie Dupont", "identity": { "sub": "lu_9c1e4b7a0d5f2e8a3b6c1d4e7f0a2b5c", "name": "Marie Dupont", "email": "marie@example.com", "email_verified": true, "phone": null, "locale": "fr", "listings_count": null } }}| Field | |
|---|---|
sub |
A stable identifier for this user for you. It never changes and differs from one partner to another: this is the key to store, not the email. |
name |
Their name. |
email |
Their email, lowercased. |
email_verified |
true if Localoge has verified that the user owns it. Only create an account automatically on that condition. |
phone |
Always null: Localoge does not verify phone numbers, so we give you nothing we cannot vouch for. |
locale |
Their language (fr, en…). |
listings_count |
Number of their listings, only if the listings scope was granted. Otherwise null. |
Nothing else is ever shared: no date of birth, no address, no ID document.
The flow
Section titled “The flow”1. Send the user to us
Section titled “1. Send the user to us”https://localoge.com/connect ?partner=your-identifier &redirect_uri=https://your-tool.com/callback/localoge &state=a-random-value-of-yours &scope=identity &code_challenge=BASE64URL(SHA256(code_verifier)) &code_challenge_method=S256| Parameter | |
|---|---|
scope |
identity for sign-in only. identity listings to also connect their properties: the user ticks or not “also link my listings” on the same screen. |
state |
Required, at least 8 characters. A random value tied to your user’s session, which we return unchanged. Check it on return. |
code_challenge, code_challenge_method |
PKCE S256, required. plain is rejected. |
redirect_uri |
Must match what you registered with us. In production: https only. |
Open this address in the user’s browser, not from your server.
2. They come back to you
Section titled “2. They come back to you”https://your-tool.com/callback/localoge?code=9f2c1a44…&state=a-random-value-of-yoursIf they decline: ?error=access_denied&state=…. Compare state with your session’s first.
3. Exchange the code, from your server
Section titled “3. Exchange the code, from your server”curl -X POST https://localoge.com/api/v1/channel/oauth/token \ -H "Authorization: Bearer $LOCALOGE_KEY" \ -H "Content-Type: application/json" \ -d '{ "code": "9f2c1a44…", "code_verifier": "the-secret-you-kept" }'The response is the one at the top of this page. Find or create the user’s account on your side
from sub, then open their session.
Good practice
Section titled “Good practice”- Identify by
sub, never by email. Users can change their address. - Do not merge two accounts on an unverified email (
email_verified: false). - Keep your own session. Localoge returns no access token and no refresh token: it vouches for the identity at the moment of sign-in, then it is up to you.
- Test in the sandbox:
https://sandbox.localoge.com/connectandhttps://sandbox.localoge.com/api/v1/channel/oauth/token, with yourlok_test_key. See Sandbox.
Errors on /connect
Section titled “Errors on /connect”error |
Cause |
|---|---|
invalid_scope |
Anything other than identity and/or listings. |
pkce_required |
code_challenge missing. |
invalid_pkce |
code_challenge_method is not S256, or the challenge is malformed. |
On the exchange, every error answers FORBIDDEN with the reason: code inconnu, code expiré,
code déjà utilisé, code_verifier invalide, autorisation retirée.