AzureAD / azure-activedirectory-library-for-java

MIT License
161 stars 126 forks source link

AdalCallable logs ERROR when acquireToken fails #280

Closed davidmoten closed 4 years ago

davidmoten commented 4 years ago

When I call AuthenticationContext.acquireToken and there is a temporary network glitch then an ERROR line is written to the log by AdalCallable. This is undesirable for us because we monitor the log for ERROR level lines and an alert goes to on-call. The reality is we don't care about temporary network glitches because we retry every 30s and our monitoring has coverage for long outages.

The facility for the user to apply whatever logging they want already exists in the Callback we supply to the AuthenticationContext so I'd like to see the log.error line from AdalCallable removed (or otherwise set to WARN level). Is that possible?

I'm happy to make a PR.

https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/4bf234786d3e74781c4f0fe0fd1e81335488255d/src/main/java/com/microsoft/aad/adal4j/AdalCallable.java#L43-L63

@superevensteven

sangonzal commented 4 years ago

@davidmoten ADAL is now in maintenance mode, and we will only release new versions for security fixes. Have you considered using MSAL?

davidmoten commented 4 years ago

@sangonzal thanks for that. I've patched the library for our own use and we'll move to MSAL later.