0

We're implementing Microsoft B2C and I am charged with using MSAL4J 1.13.4 for our java-based web-app clients. I've been provided with an Authority string but it doesn't work against MSAL4J due to the format:

https://sadoenswb2c.b2clogin.com/sadoenswb2c.onmicrosoft.com/b2c_1a_dta_single_abn_authentication/

The MSAL4J source code accepts three types of format, AAD, ADFS, and B2C. None of those Authority types work with the above. The B2CAuthority type error is:

275345 [nio-8080-exec-4] INFO  sw.mw.msal.BusinessHubAuthUtil  - Authority: https://sadoenswb2c.b2clogin.com/sadoenswb2c.onmicrosoft.com/b2c_1a_dta_single_abn_authentication
275413 [nio-8080-exec-4] ERROR .nsw.mw.msal.BusinessHubFilter  - Exception that is not a MsalException
java.lang.IllegalArgumentException: Unsupported authority type. Please use B2C authority
        at com.microsoft.aad.msal4j.AbstractClientApplicationBase$Builder.b2cAuthority(AbstractClientApplicationBase.java:243)

This is expected due to the code, the URL is lacking the "tfp" segment. But my server-side team claims their URLs are standard and should be usable.

On examination of the source I can see the Builder pattern in use (which is great) but both the PublicClientApplication and ConfidentialClientApplication classes are fully encapsulated. It doesn't seem to be possible to pass in an Authority subclass that I could customize to our own situation.

Any help on this would be appreciated. I guess confirmation that the server team is actually giving us a valid B2C Authority would help, or if anyone has used MSAL4J and had it work with B2C.

1 Answers1

0

I solved this with the help of a friend. Even though it is counter-intuitive, if you input a URL constructed from the segments of host, tenant, and policy, and add in the tfp segment, the MSAL4J library will accept it and do the right thing. So the Authority string is more of a spec than an actual URL. This not explained anywhere in the Microsoft Azure doco.