Skip to content

feat: ADR-288 deep link token authentication#307

Closed
kuruk-mm wants to merge 6 commits into
mainfrom
adr-288
Closed

feat: ADR-288 deep link token authentication#307
kuruk-mm wants to merge 6 commits into
mainfrom
adr-288

Conversation

@kuruk-mm

Copy link
Copy Markdown
Member

No description provided.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 21, 2025

Copy link
Copy Markdown

Deploying adr with  Cloudflare Pages  Cloudflare Pages

Latest commit: 854b3a7
Status: ✅  Deploy successful!
Preview URL: https://fa9037ec.adr-cvq.pages.dev
Branch Preview URL: https://adr-288.adr-cvq.pages.dev

View logs

@kuruk-mm
kuruk-mm marked this pull request as ready for review November 25, 2025 23:06
@kuruk-mm
kuruk-mm requested a review from a team as a code owner November 25, 2025 23:06
@kuruk-mm
kuruk-mm requested a review from aleortega November 25, 2025 23:06

@LautaroPetaccio LautaroPetaccio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! 👍 I've left some comments to review

participant Server as 🔒 Auth Server

User->>Client: Presses "Sign In" button
Client->>Client: Generates session & displays verification code (e.g., "67")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client generates the identity, sends it to the auth-server and the auth-server sends back the sessio token

Suggested change
Client->>Client: Generates session & displays verification code (e.g., "67")
Client->Server: Generates log-in request & displays verification code (e.g., "67")
Server-->>Client: Responds with the request session token

- **Multiple context switches**: Users must switch between the Decentraland client and web browser multiple times
- **Manual verification step**: Users must manually read and confirm the verification code, adding cognitive load
- **Confusing for new users**: The verification process is not intuitive, especially for first-time users
- **High entry flow drop rate**: The complex multi-step process results in a high drop-off rate during onboarding

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this seems to be part of the conclusion, caused by the issues, and it's explained down below, WDYT about removing it?


### Deep Link Token Verification Flow

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is defined in ## RFC 2119 and RFC 8174 Would you mind removing it?


## Abstract

This ADR proposes adding a new opt-in alternative to the current verification code mechanism in Decentraland's sign-in flow: a more secure deep link token verification approach. The current system requires users to manually verify a code displayed in the client matches the one shown during web-based social login, which contributes to a high entry flow drop rate and is vulnerable to session hijacking attacks when authentication URLs are shared. The proposed deep link approach uses OS-level protocol handling to ensure tokens are delivered only to the local client, preventing impersonation attacks while significantly improving user experience by eliminating the manual verification step. This streamlined flow aims to reduce user abandonment during onboarding. The existing verification code mechanism will remain as the default authentication method, with the deep link flow available via an explicit `use_token=true` parameter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This ADR proposes adding a new opt-in alternative to the current verification code mechanism in Decentraland's sign-in flow: a more secure deep link token verification approach. The current system requires users to manually verify a code displayed in the client matches the one shown during web-based social login, which contributes to a high entry flow drop rate and is vulnerable to session hijacking attacks when authentication URLs are shared. The proposed deep link approach uses OS-level protocol handling to ensure tokens are delivered only to the local client, preventing impersonation attacks while significantly improving user experience by eliminating the manual verification step. This streamlined flow aims to reduce user abandonment during onboarding. The existing verification code mechanism will remain as the default authentication method, with the deep link flow available via an explicit `use_token=true` parameter.
This ADR proposes adding a new opt-in alternative to the current verification code mechanism in Decentraland's sign-in flow: a more secure deep link token verification approach. The current system requires users to manually verify if a code displayed in the client matches the one shown during web-based social login, which contributes to a high entry flow drop rate and is vulnerable to session hijacking attacks when authentication URLs are shared. The proposed deep link approach uses OS-level protocol handling to ensure tokens are delivered only to the local client, preventing impersonation attacks while significantly improving user experience by eliminating the manual verification step. This streamlined flow aims to reduce user abandonment during onboarding. The existing verification code mechanism will remain as the default authentication method, with the deep link flow available via an explicit `use_token=true` parameter.

8. The AUTH CHAIN enables cryptographic signing capabilities within Decentraland

```mermaid
sequenceDiagram

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if I would keep the mermaid and the bullet point lists, as both of them communicate the same process, whaty do you think about keeping one of them?


**Status**: This option WILL remain as the default authentication method. The new deep link approach will be available as an opt-in alternative via the `use_token=true` parameter.

### Option 2: Deep Link Token Verification (Proposed - To Be Implemented)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also an alternative for this that does not require the server at all, which is to generate the identity on the site, and send it through a deep-link, base64 or URLEncoded. We've tried it before and if I'm not wrong, it will fit the length of deep-links.

The web application MUST:
- Present social login options (Google, etc.)
- Complete the authentication flow with the chosen provider
- NOT send the AUTH CHAIN immediately after successful login

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following this implementation, after logging in, the site should send the server the auth-chain to initiate the storage process which will result in the token being returned.

- Generate a cryptographically secure random token (RECOMMENDED: at least 128 bits of entropy)
- Store the token temporarily with an association to:
- The authenticated user identity
- The original session identifier

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the original session identifier?


For web-based explorers or environments where a native client is not available, alternative authentication mechanisms MUST be provided (outside the scope of this ADR).

### Security Considerations

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section seems to be providing information already explained before, WDYT about removing it?

9. Server validates the token and returns the AUTH CHAIN

```mermaid
sequenceDiagram

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sames as before, as we're already describing the process in the bullet points, what do you think about including only one of them?

@kuruk-mm kuruk-mm closed this Dec 11, 2025
@kuruk-mm

Copy link
Copy Markdown
Member Author

Superseed by #312

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants