Skip to content

fix: give the agent a short sign-in link in Each user signs in mode (1.0.1) - #4184

Closed
ForeignKeyCN wants to merge 1 commit into
langgenius:mainfrom
ForeignKeyCN:fix/short-signin-link
Closed

ForeignKeyCN wants to merge 1 commit into
langgenius:mainfrom
ForeignKeyCN:fix/short-signin-link

Conversation

@ForeignKeyCN

Copy link
Copy Markdown
Contributor

Problem

In Each user signs in mode, the tool returns a sign-in link and the agent passes it on to the user in its reply. The agent retypes the link rather than copying it, and a long random value does not always survive that. In a real chat, one character of the state parameter changed case (...X3FQ became ...X3fQ), so the callback endpoint showed "Sign-in link not recognized".

Fix

  • The tool now returns a short link to the plugin's own sign-in endpoint: <sign-in endpoint>?start=<id>.
    • The id is 12 lowercase characters without look-alikes (0/o, 1/l).
  • The endpoint redirects (302) to the provider's sign-in page that the tool stored.
    • The state and PKCE values go to the provider and come back without passing through the agent.
  • A mistyped, unknown, used or expired short link shows a page that asks the user to get a new link from the chat.
  • The agent is told to hand out "this exact link".

Nothing changes for administrators: same endpoint, same redirect URI, same credential.

Plugins (1.0.0 → 1.0.1)

outlook, teams, onedrive, microsoft_excel_365, microsoft_todo, sharepoint, jira, confluence, trello, google_calendar

The open PRs for gmail (#4180), google_drive_tool (#4181) and google_sheets (#4182) already include the same change.

Tests

  • Unit tests pass for every plugin.
  • New tests check that:
    • the tool returns the short link;
    • the short link redirects to the sign-in page;
    • a mistyped or unknown short link is refused.
  • End to end on a test Dify instance: a chat agent handed out the short link, the endpoint redirected it to Google (302), the callback accepted the sign-in (200), and the tools then ran as the signed-in user.

Applies to outlook, teams, onedrive, microsoft_excel_365, microsoft_todo,
sharepoint, jira, confluence, trello and google_calendar.

In "Each user signs in" mode the agent retypes the sign-in link in its
reply, and a long random state does not always survive that: in a real
chat one character changed case, so the callback endpoint could not
recognize the sign-in.

The tool now returns <sign-in endpoint>?start=<12 lowercase characters
without look-alikes>, and the endpoint redirects to the sign-in page it
stored. The state and PKCE values go to the provider and back without
passing through the agent.
@dosubot

dosubot Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

📄 Knowledge review

✏️ Suggested updates

3 page suggestions need review.

Page Library Status
README /dify-official-plugins/blob/main/tools/outlook/README.md dify-plugin-sdks ⬆️ Pushed to this PR
README /dify-official-plugins/blob/main/tools/trello/README.md dify-plugin-sdks ⬆️ Pushed to this PR
README_zh_Hans /dify-official-plugins/blob/main/tools/outlook/readme/README_zh_Hans.md dify-plugin-sdks ⬆️ Pushed to this PR

Leave Feedback Ask Dosu about dify-official-plugins

@ForeignKeyCN

Copy link
Copy Markdown
Contributor Author

Moved into #4186 together with the other change.

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.

1 participant