Skip to content

Discord OAuth2 Redirect Flow crashes iOS Applications "In App Browser" #6160

@jamesh48

Description

@jamesh48

Description

When using the iOS discord application with browser set to "In App Browser", clicking a oauth2 link correctly shows a dialogue that asks me to authorize, but on confirming authorization, the redirect uri opens the browser for about 1 second before the browser closes itself and appears to crash. Visiting a plain link without a redirect_uri works, but it seems that when the redirect_uri is invoked that the in app browser crashes.

Steps to Reproduce

https://discord.com/api/oauth2/authorize?client_id=<client_id>&redirect_uri=&response_type=code&scope=identify%20email

  1. First be sure that you are on an iOS device, in settings, set Browser to "In App Browser"
  2. Paste a valid link like the one above inside a channel in discord iOS application, response_type can be code or token.
  3. Click it and accept the authorization.
  4. The redirection starts briefly in a new browser window, then the browser window closes itself.

BONUS: After authorizing add the query parameter: prompt=none and click the link again, the browser opens a failed window, and then another which does persist, but upon closing them the whole iOS application is unresponsive and has to be closed and restarted.

Expected Behavior

The get request to the redirect_uri should be made in the in app browser, the browser should not crash- developers should be able to send back a response from the redirect route such as html that persists in the browser session or even to redirect back to the application programmatically.

Current Behavior

The redirect request is made, it is clear that a response can be received in the browser and seen very briefly, however, the window closes itself automatically.

Screenshots/Videos

No response

Client and System Information

6th Gen Ipad Pro 12.9 Inch v16.4.1
Iphone 13 Pro v16.3

Latest Discord version installed on both as of May 15th 2023

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsyncedSynced to internal tracker

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions