Notion OAuth fails with "Missing or invalid redirect_uri" in local development (source code) environment #14804

Closed
opened 2026-02-21 19:18:50 -05:00 by yindo · 0 comments
Owner

Originally created by @baonudesifeizhai on GitHub (Jun 23, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.4.3

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

When running Dify from source code in a local development environment, the Notion OAuth integration consistently fails with a "Missing or invalid redirect_uri" error, even when all configurations in both the Notion Integration settings and the local .env file appear to be correct. This suggests that the CONSOLE_API_URL environment variable is not being correctly used by the Dify backend to construct the authorization request URL.

steps to Reproduce:

Set up the Dify repository for local development following the source code deployment guide.
Create a Public Notion Integration.
In the Notion Integration settings, set the Redirect URI to http://127.0.0.1:5001/api/oauth/callback/notion.

Image

Image

✔️ Expected Behavior

The user should be redirected to the Notion login and authorization page. After approving, the user should be successfully redirected back to Dify at the specified redirect_uri, and the connection should be established.

Actual Behavior

After clicking the button to connect, the user is immediately redirected to a Notion error page with the following message:

Originally created by @baonudesifeizhai on GitHub (Jun 23, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.4.3 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce When running Dify from source code in a local development environment, the Notion OAuth integration consistently fails with a "Missing or invalid redirect_uri" error, even when all configurations in both the Notion Integration settings and the local .env file appear to be correct. This suggests that the CONSOLE_API_URL environment variable is not being correctly used by the Dify backend to construct the authorization request URL. steps to Reproduce: Set up the Dify repository for local development following the source code deployment guide. Create a Public Notion Integration. In the Notion Integration settings, set the Redirect URI to http://127.0.0.1:5001/api/oauth/callback/notion. ![Image](https://github.com/user-attachments/assets/2958323a-2c08-48af-9015-1dab465e2c9f) ![Image](https://github.com/user-attachments/assets/06fd4aa5-55c2-4298-af02-772ab3dddea0) ### ✔️ Expected Behavior The user should be redirected to the Notion login and authorization page. After approving, the user should be successfully redirected back to Dify at the specified redirect_uri, and the connection should be established. ### ❌ Actual Behavior After clicking the button to connect, the user is immediately redirected to a Notion error page with the following message:
yindo closed this issue 2026-02-21 19:18:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14804