MarcTron.ADAL 1.2.0

dotnet add package MarcTron.ADAL --version 1.2.0                
NuGet\Install-Package MarcTron.ADAL -Version 1.2.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MarcTron.ADAL" Version="1.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MarcTron.ADAL --version 1.2.0                
#r "nuget: MarcTron.ADAL, 1.2.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MarcTron.ADAL as a Cake Addin
#addin nuget:?package=MarcTron.ADAL&version=1.2.0

// Install MarcTron.ADAL as a Cake Tool
#tool nuget:?package=MarcTron.ADAL&version=1.2.0                

MTADAL Plugin for Xamarin

It is avery intuitive Plugin to use Microsoft Active Directory Authentication on Xamarin. It requires only 1 line of code.

What is this repository for?

You can learn more about MTADAL and this plugin on https://www.xamarinexpert.it/blog/adal-made-easy/

Available on Nuget: https://www.nuget.org/packages/MarcTron.ADAL/ Project website: http://www.xamarinexpert.it/ Tutorial: https://www.xamarinexpert.it/blog/adal-made-easy/ To report any issue: https://bitbucket.org/marcojak81/mtadal

SETUP

Install into your PCL/.NetStandard project and Client projects. The nuget package will automatically install the Microsoft.IdentityModel.Clients.ActiveDirectory package version 4.5.1

HOT TO USE IT

To authenticate a user using Active Directory you just need this line of code:

AuthenticationResult data = await MarcTron.Plugin.MTADAL.Current.Authenticate(Authority, GraphResourceUri, ClientId, ReturnUri);

where

Authority
GraphResourceUri
ClientId
ReturnUri

are strings configured according to your Active Directory.

ADDITIONAL INFO

this Plugin exposes other two methods:

HasLoginData(Authority): to check if a token is already present inside the ADAL cache

Logout(Authority) : With this method you can allow the user to log out clearing the ADAL cache

ClearCache(Authority) : To clear the cache

IMPORTANT FOR ANDROID

Add the following override to your MainActivity file (in your Android project).

protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
	base.OnActivityResult(requestCode, resultCode, data);
	AuthenticationAgentContinuationHelper.SetAuthenticationAgentContinuationEventArgs(requestCode, resultCode, data);
}

Without this method, your project will not get a response from Active Directory

Supported Platforms

  • Android
  • iOS
  • UWP
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.3 is compatible.  netstandard1.4 was computed.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 was computed.  netstandard2.1 was computed. 
.NET Framework net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed.  monoandroid81 is compatible. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 was computed.  uap10.0.16299 is compatible. 
Xamarin.iOS xamarinios was computed.  xamarinios10 is compatible. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.0 1,453 7/21/2019
1.1.0 760 3/1/2019
1.0.5 1,124 7/25/2018
1.0.4 1,047 6/21/2018
1.0.3 971 6/14/2018
1.0.2 1,067 3/28/2018
1.0.1 1,019 3/1/2018
1.0.0 922 3/1/2018

Version 1.2
       Updated to Microsoft Active Directory 5.1.0
     Version 1.1
       This version has been rewritten using multitargeting.
       Microsoft Active Directory updated to version 4.5.1