Azure Offline Authentication

Viewed 1912

Im currently looking at implementing Azure into my current xamarin.ios application. However, I have followed the tutorials on the Microsoft website for implementing Azure and more specifically the Azure authentication through the Microsoft account option.Tutorial Link

What I wanted to know if its possible to have a system where-by when my app is offline (Which I will need), I want a token system where-by you can enter a PIN or password and still login to your account. Specifically the account which has already been logged into so all the user would need to do is enter a PIN when they are offline. Im not sure if this is possible but hopefully somebody can help.

Thanks Jamie

1 Answers

Azure AD Authentication allows you to grab an access token for this user with a given expiration date. You could store this locally and refresh it when the device is online. This will basically authenticate your user based on their token.

In a full offline-only scenario where you might go offline for weeks at a time (and thus the expiration token is not a feasible option) I would recommend for you to build the "PIN"-system yourself. It's quite trivial (a lot of apps do this), and you can store it locally. Make sure to store it securely (e.g. with Microsofts' secure storage nuget package): https://docs.microsoft.com/en-us/xamarin/essentials/secure-storage?tabs=ios

Related