OneDrive / onedrive-sdk-dotnet-msa-auth-adapter

Other
25 stars 22 forks source link

Not being redirected to the sign in portal - just a white sign in box shows #36

Open jaycdave88 opened 7 years ago

jaycdave88 commented 7 years ago

I am coding against the OneDrive.SDK.Authentication lib in my console application. When I go to execute the application I get just a white window and nothing else, I would imagine that I should be prompt to enter my credentials?

Code:

class Program
{
    [STAThread]
    static void Main()
    {
        RunTask().Wait();
    }

    static async Task RunTask(OneDriveClient oneDriveClient = null)
    {
        if (oneDriveClient == null)
        {
            var msaAuthenticationProvider = new MsaAuthenticationProvider("33d64d8d-77a3-4d4c-b837-6c4798671038", "https://login.live.com/", new[] { "onedrive.readonly", "wl.signin" });
            await msaAuthenticationProvider.AuthenticateUserAsync();
        }
}

`

daboxu commented 7 years ago

hi @jaycdave88 , right now the Desktop version does rely on an WebUI component which I received notice about it won't work with console app, will my answer to get OAuth endpoint for Asp.net web app help you here https://github.com/OneDrive/onedrive-sdk-dotnet-msa-auth-adapter/issues/21? Based on my thoughts, you can implement IAuthProvider with OAuth url generated by OAuthHelper to talk to OAuth endpoint via HTTP request. Feel free to send us a console version authprovider if you find a way out. Thanks!