OAUTH basic plugin and redirect url

AI-generated summary

In a discussion about the OAUTH basic plugin and redirect URLs under the SSO category with oauth2 tags, Wurzelseppi asks how to configure Discourse to generate a specific redirect URL for OAuth2 authentication, since their OAuth provider enforces a fixed callback URL (ending in /auth/oauth2/callback) that conflicts with Discourse’s default (/auth/oauth2_basic/callback). david responds that Discourse does not allow configuration of the callback URL and that the only workaround would be to fork and modify the plugin’s code — which Wurzelseppi humorously declines, preferring to negotiate with the provider instead, noting that altering the plugin code wouldn’t make much sense. The issue stems from an unusual provider restriction, as typically the consumer (Discourse) defines the callback URL.

Hey guys,

how can I configure how discourse generates the redirect url. My problem is that my oauth provider configured this (and can´t change it due to conventions):

https://…/auth/oauth2/realms/root/realms/../authorize?client_id=…&redirect_uri=https://…/auth/oauth2/callback&response_type=code&scope=openid+profile+email&state=..

and my discourse instance generates this:

https://…/auth/oauth2/realms/root/realms/../authorize?client_id=…&redirect_uri=https://…/auth/oauth2_basic/callback&response_type=code&scope=openid+profile+email&state=..

How can I change this ?

Thanks and greetings,

Julian

The callback URL is not configurable on Discourse. The only way to change it would be to create a copy of the plugin and modify its code.

This is quite unusual, normally the consumer can define the callback URL

Hi there,

then I’ll have to speak firm words with him :slight_smile:
Thanks man, I don’t want to change the code of the plugin … wouldn’t make too much sense, would it? ..

Cheers, Wurzelseppi