mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-22 20:47:28 +01:00
Merge pull request #1448 from tgstation/MSOsKajigger [TGSDeploy]
Add's a UserInformationUrlOverride configuration option
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<!-- This is in it's own file to help incremental building, changing it causes a complete rebuild of the web panel -->
|
||||
<TgsControlPanelVersion>4.17.0</TgsControlPanelVersion>
|
||||
<TgsControlPanelVersion>4.18.0</TgsControlPanelVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
<!-- Integration tests will ensure they match across the board -->
|
||||
<Import Project="ControlPanelVersion.props" />
|
||||
<PropertyGroup>
|
||||
<TgsCoreVersion>5.7.3</TgsCoreVersion>
|
||||
<TgsConfigVersion>4.4.0</TgsConfigVersion>
|
||||
<TgsCoreVersion>5.8.0</TgsCoreVersion>
|
||||
<TgsConfigVersion>4.5.0</TgsConfigVersion>
|
||||
<TgsApiVersion>9.9.0</TgsApiVersion>
|
||||
<TgsApiLibraryVersion>10.3.0</TgsApiLibraryVersion>
|
||||
<TgsClientVersion>11.3.0</TgsClientVersion>
|
||||
|
||||
@@ -16,5 +16,10 @@ namespace Tgstation.Server.Host.Configuration
|
||||
/// The authentication server URL. Not used by all providers.
|
||||
/// </summary>
|
||||
public Uri RedirectUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User information URL override. Not supported by the <see cref="Api.Models.OAuthProvider.GitHub"/> provider.
|
||||
/// </summary>
|
||||
public Uri UserInformationUrlOverride { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user