ADAL 4 (experimental) behaves differently for Windows Desktop/Native and Windows Phone with B2C

Viewed 392

I want to create a Windows Phone 8.1 app with Azure AD B2C authentication. As basis I used the B2C Windows Desktop/Native Client sample.

The desktop app works pretty fine. In my WP8.1 adoption I run into the first problem at the point, where I want to acquire the token:

result = await authContext.AcquireTokenAsync(new string[] { Globals.clientId },
                null, Globals.clientId, new Uri(Globals.redirectUri),
                platformParams, Globals.signInPolicy);

While I get a nice and shiny token for the desktop app, for the WP8.1 app (after coming back from the WebAuthenticationBroker) I only get a ...?code=...... response.

I'm not sure but for me it seems that the WP8.1 library works in a kind of OIDC model where the 1st call goes to the authorize and the 2nd to the token endpoint.

Picking up from there I tried to continue with the authorization code received with a

var result = await authContext.AcquireTokenByAuthorizationCodeAsync(authCode, new Uri(Globals.redirectUri),
                credApp, new string[] { "" }, Globals.signInPolicy );

but no matter how I try to pass in the ClientCredential or ClientAssertion I always end up with a plain 400 Bad request (no more details are returned).

Someone please tell me where I'm wrong and/or point me into the right direction.

2 Answers
Related