Assistance to Oauth2
string clientId = “***-****.apps.googleusercontent.com”;
String redirectUri = "What is there to be?“;
string scope = “email”
string url = $"https://accounts.google.com/o/oauth2/auth?client_id={clientId}&response_type=token&redirect_uri={redirectUri}&scope={scope}";
WebAuthenticatorResult authResult
try
by {
AuthResult = await Microsoft.Maui.Authentication.WebAuthenticator.AuthenticateAsync(
The new Uri (url)
new Uri (redirect Uri)
String accessToken = authResult.
The
Catch (TaskCanceledException e)
by {
The
Not necessarily to do through WebAuthenticatorResult, you can through the Browser, etc.
В мене є код, в якому відбувається відкриття браузера, та можливість вибрати аккаунт GOOGLE, і мені треба, щоб після вибору аккаунта браузер закривався і в мою програму передавався access_token.
string clientId = "***-****.apps.googleusercontent.com";
string redirectUri = "ЩО ТУТ МАЄ БУТИ?";
string scope = "email";
string url = $"https://accounts.google.com/o/oauth2/auth?client_id={clientId}&response_type=token&redirect_uri={redirectUri}&scope={scope}";
WebAuthenticatorResult authResult;
try
{
authResult = await Microsoft.Maui.Authentication.WebAuthenticator.AuthenticateAsync(
new Uri(url),
new Uri(redirectUri));
string accessToken = authResult?.AccessToken;
}
catch (TaskCanceledException e)
{
}
Не обов'язково, щоб робилося через WebAuthenticatorResult, можна через Browser і т.д.
-
9 Good day . For Google to know where to send the user after authorization is used redirectUri. redirectUri is an address that has to have the AccessToken parameter to get it. I would say that it is more similar to a scenario when you move from a browser rather than from a desktop application. Is there any examples in the documentation for desktop applications?
-
3526 51 2 Good day . My name is Alexander. I have 3 years of business experience using .net technology. I am specialized in Backlink development. Love will help you solve your problem, write.
Current freelance projects in the category C#
Refinement of 1C UT 11 for Zebra TSD (RDP): different sound signals when scanning
22 USD
Configuration: 1C UT 11 Address warehouse Zebra TC26 TSD Work via RDP Product scanning is performed in receiving, placement, picking documents, and other warehouse operations. Current problem: Warehouse workers operate through the Zebra TSD. When scanning, they do not always… C#, Databases & SQL ∙ 19 hours 38 minutes back ∙ 5 proposals |
Comparative analysis of the effectiveness of custom software (v2.2-field) and reference software (Meshtastic v2.x)
22 USD
Comparative analysis of the effectiveness of custom software (v2.2-field) and reference software (Meshtastic v2.x) on the identical hardware platform (ESP32 + SX1268, 2W) based on the criteria of range, throughput, link stability, and power consumption. Conduct tests with… C & C++, C# ∙ 12 days 7 hours back ∙ 3 proposals |