4
votes

I have a Xamarin.Forms iOS/Android app and have to authenticate the user against a Microsoft Azure B2C AD.

I have added the Microsoft.Identity.Client NuGet and using this for authentication.

Login works fine and I am able to use the returned token to call an Azure hosted service of our own.

The app needs to work offline also and from what I understand from Azure AD B2C preview: Token reference I should be able to obtain a "refresh token" with longer life-span if I provide the scope offline_access.

However, if I do provide this scope, the library throws an exception that offline_access is not supported.

My question is: is this because the MSAL currently does not support offline_access at all or am I supposed to obtain the same in a different manner?

1
I would be very interested in this as well, for a UWP application scenario.Lars Kemmann

1 Answers

0
votes

I use Microsoft.Experimental.IdentityModel.Clients.ActiveDirectory for this which you can install from Package Manager console with

install-package Microsoft.Experimental.IdentityModel.Clients.ActiveDirectory -pre

Samples:

I guess one of the samples can also be applied to UWP