diff --git a/docs/API.dox b/docs/API.dox index 0a27032d8e..66f79a3174 100644 --- a/docs/API.dox +++ b/docs/API.dox @@ -128,7 +128,7 @@ TGS4 supports OAuth 2.0 with select providers for authentication. The flow for this is as follows: -- Retrieve the @ref api_ver to find out available OAuth providers and their respective client ID and redirect URIs. +- Retrieve the @ref api_ver to find out which @ref Tgstation.Server.Api.Models.OAuthProvider are enabled and their respective information. - Send the user to the Authorization Request endpoint for the provider using the client ID from above. See https://tools.ietf.org/html/rfc6749#section-4.1.1. DO NOT specify a redirect URI, this should be configured in the provider. - Retrieve the authorization response code after successfully completing the authorize step above. - Perform the following request: diff --git a/src/Tgstation.Server.Api/Models/OAuthProviderInfo.cs b/src/Tgstation.Server.Api/Models/OAuthProviderInfo.cs index 10466c3204..6163e445f4 100644 --- a/src/Tgstation.Server.Api/Models/OAuthProviderInfo.cs +++ b/src/Tgstation.Server.Api/Models/OAuthProviderInfo.cs @@ -16,5 +16,10 @@ namespace Tgstation.Server.Api.Models /// The redirect URL. /// public Uri? RedirectUri { get; set; } + + /// + /// The server URL. + /// + public Uri? ServerUrl { get; set; } } } diff --git a/src/Tgstation.Server.Host/Security/OAuth/GenericOAuthValidator.cs b/src/Tgstation.Server.Host/Security/OAuth/GenericOAuthValidator.cs index ad0de1e980..4a6beb15e6 100644 --- a/src/Tgstation.Server.Host/Security/OAuth/GenericOAuthValidator.cs +++ b/src/Tgstation.Server.Host/Security/OAuth/GenericOAuthValidator.cs @@ -127,7 +127,8 @@ namespace Tgstation.Server.Host.Security.OAuth new OAuthProviderInfo { ClientId = OAuthConfiguration.ClientId, - RedirectUri = OAuthConfiguration.RedirectUrl + RedirectUri = OAuthConfiguration.RedirectUrl, + ServerUrl = OAuthConfiguration.ServerUrl }); } }