GNAP grants need continuation and interaction references tied to one another
GNAP grants need continuation and interaction references tied to one another The Grant Negotiation and Authorization Protocol gives a client instance a structured way to ask an authorization server for delegated access
GNAP grants need continuation and interaction references tied to one another
The Grant Negotiation and Authorization Protocol gives a client instance a structured way to ask an authorization server for delegated access. RFC 9635 defines grant requests, continuation handles, access tokens, interaction modes, and the key material used to protect the exchange. The security model is not a renamed OAuth flow. It assumes the client instance can continue a grant and can prove possession of its key while the authorization server keeps transaction state.
A client starts with a grant request that includes its requested access and its client key. The authorization server can respond with a continuation handle, a grant access token, an interaction requirement, or an access token for the resource. The client uses the continuation handle and its key proof to update the grant. RFC 9767 covers the resource server connection and token format used when the grant is completed. Implementers need to preserve the relationships among those objects, not store them as unrelated values.
Treat the continuation handle as state
The continuation handle identifies an ongoing grant, and the client instance must present its proof with each continuation request. The server should bind the handle to the client key, requested access, interaction state, and expiration. A handle that remains valid after the grant is completed, or after the client key changes, creates an unnecessary replay path.
State should also survive a restart. If the client stores only the final access token, an interrupted interaction cannot be finished or cleanly abandoned. If the server stores only a user identifier, it cannot tell which continuation request owns the pending interaction. Durable records should include the grant identifier, client instance, requested access, interaction reference, transaction state, and expiry.
Verify the interaction finish
GNAP interaction methods include redirects, application launches, and user codes. When an interaction finishes, the authorization server creates an interaction reference and returns it to the client with a hash. The client sends the reference back in its continuation request. The interaction reference must be sufficiently random and one-time-use, and the client must verify the interaction hash before accepting the callback.
RFC 9635 explains that the hash calculation protects against injection of a spurious interaction reference. The authorization server also binds the continuation access token to the expected reference. Skipping the client-side hash check leaves one half of that defense unused. A callback URL that accepts any interact_ref value, or that does not associate the callback with a pending grant, can let an attacker attach a different interaction to the client session.
Keep access requests narrow
Each grant should describe the resource owner, client, actions, resource, and any limits on the requested access. When the client updates a grant, the server should apply the existing policy to the new request and invalidate state that no longer matches. Do not let a continuation handle authorize a broader resource set merely because the original user interaction succeeded.
Use a distinct token audience for each protected resource. Validate the token at the resource server and keep the authorization server's decision record available for investigation. A resource server that accepts a grant token meant for another service has lost the audience boundary even if the signature is valid.
Operate the lifecycle
Log grant creation, continuation, interaction completion, token issuance, token refresh, and revocation with correlation identifiers. Do not log client key secrets, continuation handles in full, or access tokens. Alert on repeated invalid client proofs, unknown handles, reused interaction references, and grants that stay pending beyond their configured lifetime.
Test restart recovery and clock skew with the same care as the happy path. GNAP depends on cryptographic proofs and state transitions, so a retry can be safe only when the server can recognize the original transaction. A new request with a new key and handle is a new grant, not a recovery of the old one.
References
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.