Preparing Authwave clients for v1: the security details behind a simple login

Adding login should leave you with a small amount of application code and a clear understanding of what it does. Behind those few calls, the client needs to handle browser sessions, encrypted messages and the journey back from the provider with care.

A short integration needs careful behaviour

Adding login should leave you with a small amount of application code and a clear understanding of what it does. Behind those few calls, the client needs to handle browser sessions, encrypted messages and the journey back from the provider with care.

As part of preparing Authwave's clients for v1, we've been reviewing those boundaries and their dependencies. We looked beyond a successful sign-in: what happens when a request is unexpected, configuration is wrong, or someone interrupts a login halfway through?

The changes below are in public pull requests, with passing checks at the time of writing. They are still awaiting merge. This is a look at the preparation, rather than an announcement that every change is already in a published package. The review is our engineering work, not an independent security certification.

Give the signed-in session a fresh identifier

This change prevents mitigates against "session fixation".

A visitor may browse anonymously before choosing to sign in. Once authentication succeeds, the browser's session represents someone with access to private information. That transition deserves a fresh session identifier.

The proposed session changes regenerate the identifier before saving the newly authenticated identity, invalidate the old session and preserve unrelated session data. This helps prevent an earlier identifier from becoming a way into the signed-in session.

The regression tests cover access through the old session, repeated responses and failures during regeneration. Applications supplying a custom session container also need to support regeneration; that requirement belongs in the integration, rather than being silently skipped.

Keep the return journey inside the application

This change prevents malicious use of your site's URL to redirect elsewhere.

After processing a login response, the client cleans the response parameter out of the browser's address. That small redirect should keep someone on the application's own path.

The redirect changes build the destination from a local path, excluding a scheme, hostname or credentials while preserving other query values and the fragment. This prevents response cleanup from becoming a redirect to an attacker-controlled website. Tests cover encoded paths and callbacks both with and without an authenticated session.

Your application still needs to control any onward destination it accepts. Cleaning up the authentication response doesn't validate every redirect elsewhere in your code.

Bind a token to one encrypted request

This change prevents token reuse attacks.

Encrypted messages have rules that the client must enforce. One is that different messages must not be encrypted with the same key and nonce, a value used by the encryption operation.

The token changes bind each token to one request. Repeating that same request remains possible, but attempting to encrypt a different payload with the token is rejected. The binding survives saving and restoring the session, so persistence cannot accidentally remove the protection.

Regression tests exercise different payloads, identical retries and serialisation. The intended behaviour is straightforward: retrying an operation should not quietly permit a different operation to reuse its encryption state.

Reject unexpected input predictably

The PHP client has additional validation changes for malformed client keys and unexpected callback data. Identity fields are checked consistently before a response is accepted, including when decoding a token.

A rejected response must also leave the pending authentication session intact. Otherwise, bad input could consume the state needed for a legitimate return. The validation changes and regression tests make those failure cases explicit.

Make the evidence available

Session, redirect and token protections have corresponding pull requests for PHP, TypeScript, Python and Go. Each repository's PRs numbered 1–3 cover those protections, except PHP, where they are numbered 27–29. Their Checks tabs record the passing CI runs; their Files changed tabs include the regression tests.

PHP's separate dependency update refreshes the Composer lock, replaces versions affected by known advisories and adds automated lock validation and auditing. Those checks include development dependencies as well as runtime packages. Passing tests and a clean audit provide useful evidence, not proof that no vulnerabilities remain.

Plan adoption around the released client

Before adopting v1, check its merged release contents, use the client and integration guide for your stack, and exercise sign-in and sign-out in staging. Keep client keys private and apply your application's access rules to the returned identity.

Security maintenance continues after v1 through dependency checks, regression testing and clear release notes. Explore the client repositories above for implementation details and integration guides. For concerns, follow our security reporting instructions and report privately.

Looking to make your first open source contribution?

We will provide free mentorship to help you make your first commit on GitHub.

Book demo
Illustration of an open code editor with colourful lines of code