Authenticate with Custom JWT Token issue

Dear all,

I am working on a Flutter Web app and authenticate users with Microsoft Entra ID which I get a JWT session token from. I would like to authenticate Atlas App Services with this JWT token as well.
The setting is set so any organisation can log in, the openid configuration link is given as follows:
https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration
Here I get the JWKS URI

When I try to authenticate users with:
https://my-region.services.cloud.mongodb.com/api/client/v2.0/app/my-app-id/auth/providers/custom-token/login , I get the following error:
crypto/rsa: verification error

I would appreciate it greatly if anyone could help me with this.

Best regards,

@Olivier_Segers did you ever figure this out? Trying to do the same thing and getting the same error.

I made it work by exposing an api in Azure then setting that to the scope.
See following link: authentication - How to add aud field to a token generated by Azure AD for v1.0 endpoint? - Stack Overflow

That worked great. Thank you!