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

Other
26 stars 22 forks source link

Get CredentialCache / silent token refresh with MSA but without App Store association #62

Open SERWare opened 6 years ago

SERWare commented 6 years ago

Hi,

I'm testing a UWP application and authentication works well using the Authenticate() method of the MSA provider. But when I try to use the example to get the Credential Cache using RestoreMostRecentFromCacheOrAuthenticateUserAsync(), I get an exception.

System.ArgumentException HResult=0x80070057 Message=Value does not fall within the expected range. Source=System.Private.CoreLib StackTrace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

I think it's because I don't have associated the App in the Store. But I don't want to create an account in the store until the application works correctly. So I have two questions:

Is it possible to get the CredentialCache without associating the UWP application in the store?

What happens if I try the same in a WPF Net 4.7.1 application that cannot be associated with the store?

Thanks