Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class AuthenticationService
- {
- private static readonly HttpClient client = new HttpClient();
- public static async Task<bool> ProcessAuthenticationAsync(string code)
- {
- var apiEndPoint = "https://discord.com/api/v6/oauth2/token";
- //var data = new CodeAuthRequest
- //{
- // Client_Id = "610549254980632628",
- // Client_Secret = "eGJl-F2lWfNSVJ37gTFtewc9hIKnSqgE",
- // Grant_type = "'authorization_code'",
- // Code = code,
- // RedirectUri = "https://www.nopressureffxiv.com/authentication/discordauth",
- // scope = "'identify email connections'"
- //};
- var values = new Dictionary<string, string>
- {
- { "Client_ID", "610549254980632628" },
- { "Client_Secret", "eGJl-F2lWfNSVJ37gTFtewc9hIKnSqgE" },
- { "Grant_type", "authorization_code" },
- { "Code", code },
- { "RedirectUri", "https://www.nopressureffxiv.com/authentication/discordauth" },
- { "scope", "identify email connections"}
- };
- var content = new FormUrlEncodedContent(values);
- var response = await client.PostAsync(apiEndPoint, content);
- var responseString = await response.Content.ReadAsStringAsync();
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement