-
Notifications
You must be signed in to change notification settings - Fork 155
Provide more information in error case #328
Copy link
Copy link
Closed
Labels
QuestionAny questions about how MSAL Java worksAny questions about how MSAL Java works
Description
I run a simple example in my application to acquire a token. I get the following error message:
Caused by: com.microsoft.aad.msal4j.MsalClientException: Cached JWT could not be parsed: Invalid JWT serialization: Missing dot delimiter(s)
at com.microsoft.aad.msal4j.AuthenticationResult.getTenantProfile(AuthenticationResult.java:54) ~[msal4j-1.8.1.jar!/:1.8.1]
at com.microsoft.aad.msal4j.AuthenticationResult.tenantProfile(AuthenticationResult.java:353) ~[msal4j-1.8.1.jar!/:1.8.1]
at com.microsoft.aad.msal4j.AuthenticationResult.hashCode(AuthenticationResult.java:283) ~[msal4j-1.8.1.jar!/:1.8.1]
The confusing part, my sample app (just to play around) and the productive ap share the exactly the same code. But in my productive I get the stacktrace. It's really frustrating that there is now meaningful log!
Code sample:
ConfidentialClientApplication app =
ConfidentialClientApplication.builder(clientId, ClientCredentialFactory.createFromSecret(secret))
.authority("https://login.microsoftonline.com/tenant")
.build();
ClientCredentialParameters clientCredentialParam =
ClientCredentialParameters.builder(Collections.singleton(SCOPE)).build();
IAuthenticationResult
result = app.acquireToken(clientCredentialParam).join();
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
QuestionAny questions about how MSAL Java worksAny questions about how MSAL Java works