How sign-in works
Novren ID uses OAuth 2.1 with PKCE, the authorization-code flow every modern provider uses, with one addition: alongside the code, your app receives its key for that user, sealed so that only your app can open it.
The five steps
1. Your app prepares the request
beginLogin (or createLoginRequest) creates three secrets on the user's device:
- a PKCE verifier (32 random bytes) and its SHA-256, the challenge;
- a random
state, to recognise the answer to this request; - an ephemeral key pair (X-Wing: ML-KEM-768 + X25519, resistant to quantum computers), whose public half is the
handoff_key.
Then it sends the user to:
https://account.novren.net/autorizza
?client_id=cl-…
&redirect_uri=https://myapp.example/callback
&code_challenge=… (S256)
&handoff_key=… (ephemeral public key)
&state=…
&ui_locales=en (optional)2. The user signs in and consents
On account.novren.net the user signs in, if they aren't already. The password is turned into keys and a signature on the device; the server only checks the signature. If they have two-factor authentication, it is asked here. Then the consent page shows your app's name and logo and the host they will return to. The user presses Allow or Deny.
Consent is asked at every sign-in: it is also the moment the user sees which app is receiving their key.
3. Novren ID issues a code and the browser seals the key
On Allow:
- the server issues a one-time code, valid 60 seconds, bound to the client, the callback URL and the PKCE challenge;
- still on the user's device, the account page opens your app's key for this user (creating it the first time) and seals it for the
handoff_key. The sealing context binds account, app, client and challenge: an envelope made for another request does not open.
4. The user comes back to your callback URL
https://myapp.example/callback
?code=…&state=…
#key=…&account=…&product=…&email=…The part after #, the fragment, is never sent to any server by browsers: not to Novren ID, not to your server. The sealed key and the email travel only inside the browser.
If the user pressed Deny, the callback receives ?error=access_denied&state=… instead, with no code.
5. Your app opens the key and exchanges the code
completeLogin (or finishLoginResponse):
- checks that
stateis the one it created; - opens the envelope with the ephemeral private key: now your app has
productKey; - sends the code and the PKCE verifier to
POST https://id.novren.net/oauth/token, which checks that the verifier matches the challenge and returns the tokens; - wipes the ephemeral key and the verifier, and removes code and fragment from the address bar.
Why each piece is there
| Piece | It stops |
|---|---|
| PKCE | someone who intercepts the code from using it: they don't have the verifier. |
state | an attacker from making your page complete their sign-in (login CSRF). |
| Ephemeral key | anyone except this browser tab from opening the app key, Novren ID included. |
| Fragment | servers and logs from seeing the key or the email. |
| Code valid 60 s, single use | replay. A second use of the same code also closes the session born from it. |
| Context in the envelope | an envelope from another request, client or app from being accepted. |
What can go wrong
- The user denies:
?error=access_denied. See the web guide. - The tab changed:
beginLoginkeeps the request insessionStorage, which belongs to one tab. If the sign-in starts in one tab and ends in another,completeLoginthrowsLoginRejected. See Limits. - More than 60 seconds between the consent and the exchange: the code expired, start again.
- Two-factor authentication required but not set up: Novren ID refuses with
SECOND_FACTOR_REQUIREDand offers to turn it on. See Errors.