private static async Task AuthorizeInBrowser(OAuthDesktopMobileAuthCodeGrant auth) { var browserWindow = new BrowserWindow(auth.GetAuthorizationEndpoint(), auth.RedirectionUri.AbsolutePath); browserWindow.Show(); var redirectUri = await browserWindow.GetRedirectUri(); await auth.RequestAccessAndRefreshTokensAsync(redirectUri); }
private static async Task AuthorizeImplicitlyInBrowser(OAuthDesktopMobileImplicitGrant auth) { var browserWindow = new BrowserWindow(auth.GetAuthorizationEndpoint(), auth.RedirectionUri.AbsolutePath); browserWindow.Show(); var redirectUri = await browserWindow.GetRedirectUri(); auth.ExtractAccessTokenFromUri(redirectUri); }