KoenZomers / OneDriveAPI

API in .NET Framework 4.8.0, .NET Core 3.1 and .NET 6.0 to communicate with OneDrive Personal and OneDrive for Business
Eclipse Public License 1.0
109 stars 34 forks source link

Getting RefreshToken as device code #35

Closed pogarek closed 3 years ago

pogarek commented 3 years ago

HI Thank you for the great work with the project.

I want to use it in console app . Currently the way for getting the refreshtoken require your app or browser (https://github.com/KoenZomers/OneDriveAPI/blob/master/Demo/MainForm.cs#L108 ). However this could be achieved with devicecode, if Public Flow is enabled for application in AAD (https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-device-code ). May I ask you consider adding such functionality ?

Best regards

pogarek commented 3 years ago

never mind. Solved by https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-net-token-cache-serialization?tabs=custom and using Microsoft.Graph .