public static async Task <AppTokenResult> LoginAuthorizationCodeFlowAsync(string clientId, string clientSecret, string[] scopes, IWin32Window owner = null)
        {
            var authorizationCode = await FormMicrosoftAccountAuth.GetAuthenticationToken(clientId, scopes, OAuthFlow.AuthorizationCodeGrant, owner);

            if (string.IsNullOrEmpty(authorizationCode))
            {
                return(null);
            }

            var tokens = await RedeemAuthorizationCodeAsync(clientId, FormMicrosoftAccountAuth.OAuthDesktopEndPoint, clientSecret, authorizationCode);

            return(tokens);
        }
 public static async Task <string> LoginOneTimeAuthorizationAsync(string clientId, string[] scopes, IWin32Window owner = null)
 {
     return(await FormMicrosoftAccountAuth.GetAuthenticationToken(clientId, scopes, OAuthFlow.ImplicitGrant, owner));
 }