הפסק את הודעות ה-Discord על אימות בכל כניסה

Hi there!

I’ve setup discord login on my self hosted installation. It works pretty great…except for one small thing.

When a user signs in with discord, they are taken to the authorization page every time, meaning they have to agree the authorization anytime they login. From my understanding, this should just be a one step process upon the very first time they connect discord login with discourse.

Anyway how to fix this? I followed the documentation.

3 לייקים

האם מישהו מתמודד עם הבעיה הזאת?

2 לייקים

כן, ניסיתי על המופע שלי ואני יכול לשכפל את הבעיה.

2 לייקים

Do you see the same behaviour on other sites which offer “login with Discord”? If so, it might be the expected behaviour of the Discord login system, rather than a Discourse-specific issue.

זה לא ההתנהגות המיועדת. אתרים ופורומים אחרים שאני משתמש בהם בכניסה באמצעות דיסקורד מצריכים אימות חד פעמי בלבד. לאחר מכן, בכל פעם שאתה נכנס עם דיסקורד אתה מחובר אוטומטית מבלי לגשת לדף האימות.

זה קשור ל-Discourse.

האם יש דוגמה ציבורית שתוכל לשתף כדי שנוכל לנסות את זה ולהשוות את היישום?

אני לא בטוח למה אתה מתכוון בדוגמה ציבורית, אני מתנצל.

עם זאת, זה לא הנורמה. זה אמור לדרוש אימות בודד בלבד של דיסקורד בפעם הראשונה בלבד.

I mean:

Can you share a link to one of them? Then we might be able to look at how they’re implemented, and adjust discourse to match.

Here is a message board I frequent, but it is not discourse software.

https://famiboards.com/

לייק 1

I wonder if it’s because of the missing prompt param to none in the auth URL?

prompt controls how the authorization flow handles existing authorizations. If a user has previously authorized your application with the requested scopes and prompt is set to consent , it will request them to reapprove their authorization. If set to none , it will skip the authorization screen and redirect them back to your redirect URI without requesting their authorization

לייק 1

I think you may be onto something. I found this.

Perhaps this could be updated within Discourse? As far as I know, this is not something I can do in my administrative panel, or the discord dev portal.

2 לייקים

יש הגדרת תבנית עבור Google Auth ב-Discourse, ואני חושב שיהיה הגיוני להוסיף אחת עבור Discord.

לייק 1

אני רק שמתי לב לזה גם.

האם אתה יודע היכן ממוקם קובץ ההגדרות של ההתחברות הזו בתוך Discourse? חושב להוסיף

"upstream_params": {
			"prompt": {
				"value": "none"
			}
		},

בתוך הקובץ ולבנות מחדש, כדי לבדוק אם זה פותר את הבעיה.

עריכה: במחשבה שנייה, אני לא חושב שאני יכול לאתר את הקובץ שיאפשר לי ליישם את זה. אני חושב שיש צורך בתיקון מ-Discourse כדי שזה יעבוד כפי שמתוכנן.

Since I have the issue on my instance:

Yes, wait news from the team :+1:

לייק 1

Cool. Do I need to do anything else (but wait for an update?)

I’m assuming there is no real ETA for a fix like this, and it likely depends on an urgency status flow. It’s just a minor inconvenience, I suppose. But it would be awesome to see fixed!

A change to add prompt=none sounds good to me. If someone can write, test and make a PR, that will help to expedite the change.

The relevant file would be this one, but I don’t know off-hand exactly what change would be required.

2 לייקים

Looking through the file, I added

option :authorize_params, prompt: 'none'

underneath

option :authorize_options, %i[scope permissions]

on my self hosted install.

It sort of works…, but not as we’d like.

It still takes you to the discord auth page, however, the user no longer has to click authorize. The page will reload then take you back to your discourse page.

One step forward, another step backward. :melting_face:

Edit: I see @Arkshine and I tested the change and got the same result.

לייק 1

I did a quick test (https://discourse.arkshine.dev/):

It shows the auth page but redirects automatically.

לייק 1

Even with the change, it still proceeds you to the discord authentication page - which it shouldn’t do (although this time you don’t need to manually press authenticate).

Submitting a PR with the suggested change unfortunately would not fix the issue.