AzureAD / microsoft-authentication-library-for-dotnet

Microsoft Authentication Library (MSAL) for .NET
https://aka.ms/msal-net
MIT License
1.39k stars 341 forks source link

[Bug] Authorization code is truncated causing error AADB2C90090: The provided JWE is not a valid 5 segment token. #2607

Closed NickVandewalle closed 3 years ago

NickVandewalle commented 3 years ago

Which Version of MSAL are you using ? 4.30.1

Platform .NET Framework 4.7.2

What authentication flow has the issue? Desktop / Mobile Interactive

Is this a new or existing app? An existing app with a new implementation of B2C.

Repro

Expected behavior A large set of claims should not cause an exception to occur.

Actual behavior The authorization code gets truncated whenever the claims cause the authorization code to exceed a certain size.

Additional context/ Logs / Screenshots AAD90090_Logging.txt

This issue is very similar to #2515 so it could be that this is a duplicate.

jmprieur commented 3 years ago

@NickVandewalle are you using the system browser? (I'm assuming yes, with B2C)?

NickVandewalle commented 3 years ago

@jmprieur Yes, indeed.

jennyf19 commented 3 years ago

@NickVandewalle do you have a repro you can share?

jennyf19 commented 3 years ago

@NickVandewalle have opened an ICM on B2C, as per direction from their team.

NickVandewalle commented 3 years ago

@jennyf19 I've made a repro.

What this repro does is:

If there's an issue with the repro, just let me know and I'll try to help.

Edit: FYI: I've noticed that I get an error after fetching the nugets for the first time. restarting visual studio seems to fix this.

jennyf19 commented 3 years ago

thanks @NickVandewalle, i passed this info on to the B2C side.

jennyf19 commented 3 years ago

@NickVandewalle B2C is having difficulties getting a repro on this...is it still an issue?

NickVandewalle commented 3 years ago

@jennyf19 Yes, still an issue.

I have just now successfully reproduced this via the attached repro case. Is the B2C team not able to simulate the exception via the repro case? Or do they have issues getting the solution to run in general (Because I also had to restore the nugets manually and reopen visual studio for some reason)?

jennyf19 commented 3 years ago

@NickVandewalle can you send me an email and I'll get you in touch w/the b2c side working on this. they need more specific info, if that's okay with you. jeferrie@microsoft.com

pmaytak commented 3 years ago

Hi @NickVandewalle Please see my investigation in https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/issues/2743#issuecomment-877583645 Could you try some of these workarounds?