Login System with AAD and Microsoft Identity Client

Dalton Tofoli 1 Reputation point
2022-12-06T20:11:36.943+00:00

Hello Everyone!

Im trying to implement a login system for my app (Android and IOS) with Unity. I installed NuGet for Unity and the Microsoft Identity Client as well.

Following the github Getting Started ( https://aka.ms/msal-net-up ) and setting up my Enterprise Application, Users and App Registration at my Azure AD I was able to make it work in Unity Editor.

However, when I build in my android device (Samsung S7) and test it out, I always get the following error:

MsalClientException: Unsupported User Type ' '. Please see https://aka.ms/msal-net-up.
at Microsoft.Identity.Client.Internal.Requests.UsernamePasswordRequest.FetchAssertionFromWsTrustAsync () [0x00000] in <00000000000000000000000000000000>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () [0x00000] in <00000000000000000000000000000000>:0
at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction (System.Action action, System.Boolean allowInlining, System.Threading.Tasks.Task& currentTask) [0x00000] in <00000000000000000000000000000000>:0
at System.Threading.Tasks.Task.FinishContinuations () [0x00000] in <00000000000000000000000000000000>:0
at System.Threading.Tasks.Task`1[TResult].TrySetResult (TResult resul

It does not care if I type a correct username and password or an incorrect info, it always gives the same message.

In Editor, if I type a wrong username, the message is similar:

MsalClientException: Unsupported User Type 'Unknown'. Please see https://aka.ms/msal-net-up.

The difference with the type Unknown, and it makes sense since this message means that it was unable to identify an user with info given.

I searched everywhere and all I could find was solutions that require some kind of endpoint (not a possibility in this current project right now) or was about android native development. So I decided to post it here, trying to find some light on this topic. Im new to Azure AD and relative new to Android Native Dev, if anyone could help out with some insight, I would really be very thankful.

If anyone need some more information, Im glad to give it out.

Thanks in advance.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,908 questions
{count} votes

1 answer

Sort by: Most helpful
  1. David Broggy 5,816 Reputation points MVP
    2022-12-06T20:50:54.647+00:00

    Hi Dalton,
    Have you considered using an Azure App as the front end for your authorization?

    scenario-secure-app-authentication-app-service


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.