LanceMcCarthy / MvpApi

An application for Microsoft MVPs to easily browse and upload contributions
MIT License
36 stars 10 forks source link

Better OAuth - Use RefreshToken #16

Closed LanceMcCarthy closed 6 years ago

LanceMcCarthy commented 6 years ago

If anyone wants to help make this project better, and is familiar with OAuth, I could use a hand adding in the ability to use the RefreshToken instead of getting a new access token every time the app launches.

Here's where to look for the existing login mechanism:

1 - Go to LoginPageViewModel 2 - Notice the OnNavigatedTo method

The first line loads the browser URL:

https://github.com/LanceMcCarthy/MvpApi/blob/cd409429bed72e16fddd4dcf0e216c3ff338e8e1/MvpApi.Uwp/ViewModels/LoginPageViewModel.cs#L201

This then fires off the BrowserLoaded event handler

https://github.com/LanceMcCarthy/MvpApi/blob/cd409429bed72e16fddd4dcf0e216c3ff338e8e1/MvpApi.Uwp/ViewModels/LoginPageViewModel.cs#L46

I check the navigate URL for key terms for whether I need to go to the signin URL or grab the result token.

LanceMcCarthy commented 6 years ago

Follow up note: I parse out the RefreshToken here: https://github.com/LanceMcCarthy/MvpApi/blob/cd409429bed72e16fddd4dcf0e216c3ff338e8e1/MvpApi.Uwp/ViewModels/LoginPageViewModel.cs#L109