tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
TGForumsOAuthValidator.cs
Go to the documentation of this file.
1using System;
2
3using Microsoft.Extensions.Logging;
4
8
10{
15 {
17 public override OAuthProvider Provider => OAuthProvider.TGForums;
18
20 protected override Uri TokenUrl => new("https://tgstation13.org/phpBB/app.php/tgapi/oauth/token");
21
23 protected override Uri UserInformationUrl => new("https://tgstation13.org/phpBB/app.php/tgapi/user/me");
24
33 ILogger<TGForumsOAuthValidator> logger,
34 OAuthConfiguration oAuthConfiguration)
35 : base(
37 logger,
38 oAuthConfiguration)
39 {
40 }
41
43 protected override string DecodeTokenPayload(dynamic responseJson) => responseJson.access_token;
44
46 protected override string DecodeUserInformationPayload(dynamic responseJson) => responseJson.phpbb_username;
47
49 protected override OAuthTokenRequest CreateTokenRequest(string code) => new(OAuthConfiguration, code, "user");
50 }
51}
OAuthConfiguration OAuthConfiguration
The OAuthConfiguration for the GenericOAuthValidator.
readonly IAbstractHttpClientFactory httpClientFactory
The IHttpClientFactory for the GenericOAuthValidator.
override string DecodeUserInformationPayload(dynamic responseJson)
override string DecodeTokenPayload(dynamic responseJson)
TGForumsOAuthValidator(IAbstractHttpClientFactory httpClientFactory, ILogger< TGForumsOAuthValidator > logger, OAuthConfiguration oAuthConfiguration)
Initializes a new instance of the TGForumsOAuthValidator class.
override OAuthProvider Provider
The OAuthProvider this validator is for.
override OAuthTokenRequest CreateTokenRequest(string code)
OAuthProvider
List of OAuth providers supported by TGS.