diff --git a/README.md b/README.md index c314551797..022e5d860f 100644 --- a/README.md +++ b/README.md @@ -173,6 +173,7 @@ Security: ClientSecret: "..." RedirectUrl: "..." ServerUrl: "..." + UserInformationUrlOverride: "..." # For power users, leave out of configuration for most cases. Not supported by GitHub provider. ``` The following providers use the `RedirectUrl` setting: diff --git a/build/ControlPanelVersion.props b/build/ControlPanelVersion.props index ff4985b645..fa2a82aa30 100644 --- a/build/ControlPanelVersion.props +++ b/build/ControlPanelVersion.props @@ -1,6 +1,6 @@ - 4.17.0 + 4.18.0 diff --git a/build/Version.props b/build/Version.props index 8802116119..3602e14394 100644 --- a/build/Version.props +++ b/build/Version.props @@ -3,8 +3,8 @@ - 5.7.3 - 4.4.0 + 5.8.0 + 4.5.0 9.9.0 10.3.0 11.3.0 diff --git a/src/Tgstation.Server.Host/Configuration/OAuthConfiguration.cs b/src/Tgstation.Server.Host/Configuration/OAuthConfiguration.cs index 47c47d5083..1818a15d8b 100644 --- a/src/Tgstation.Server.Host/Configuration/OAuthConfiguration.cs +++ b/src/Tgstation.Server.Host/Configuration/OAuthConfiguration.cs @@ -16,5 +16,10 @@ namespace Tgstation.Server.Host.Configuration /// The authentication server URL. Not used by all providers. /// public Uri RedirectUrl { get; set; } + + /// + /// User information URL override. Not supported by the provider. + /// + public Uri UserInformationUrlOverride { get; set; } } } diff --git a/src/Tgstation.Server.Host/Security/OAuth/GenericOAuthValidator.cs b/src/Tgstation.Server.Host/Security/OAuth/GenericOAuthValidator.cs index 8eac45f2ad..f1cccb7437 100644 --- a/src/Tgstation.Server.Host/Security/OAuth/GenericOAuthValidator.cs +++ b/src/Tgstation.Server.Host/Security/OAuth/GenericOAuthValidator.cs @@ -121,7 +121,9 @@ namespace Tgstation.Server.Host.Security.OAuth } Logger.LogTrace("Getting user details..."); - using var userInformationRequest = new HttpRequestMessage(HttpMethod.Get, UserInformationUrl); + + var userInfoUrl = OAuthConfiguration?.UserInformationUrlOverride ?? UserInformationUrl; + using var userInformationRequest = new HttpRequestMessage(HttpMethod.Get, userInfoUrl); userInformationRequest.Headers.Authorization = new AuthenticationHeaderValue( ApiHeaders.BearerAuthenticationScheme, accessToken);