Authentication failure in onedrive

154 Views Asked by At

I am getting Authentication Failure message to login to OneDrive. Here Is My Code:

public async static void Login()
{
    try
    {
        var scopes = new[] {
          "onedrive.readwrite",
          "onedrive.appfolder",
          "wl.signin"
    };

        _client = Microsoft.OneDrive.Sdk.OneDriveClient.GetMicrosoftAccountClient("d5f4ce5f-116a-4b77-a5a7-bd81802cdc7e","urn:ietf:wg:oauth:2.0:oob", scopes, null, null, null);
        OnedriveClient._client = _client;
        var session = await _client.AuthenticateAsync();
       // AppSettings.SkyDriveLogin = true;

        var AccessToken = _client.AuthenticationProvider.CurrentAccountSession.AccessToken;
        //REST API to request info about the signed-in user
        var uri = new Uri($"https://apis.live.net/v5.0/me?access_token={AccessToken}");

Here Is My Error:

enter image description here

0

There are 0 best solutions below