I'm sending an OAuth callout to https://start.exactonline.nl/api/oauth2/token When the Refresh Token is expired Exact Online returns an invalid messages. The response that is returned contains 2 WWW-Authentication headers (where 1 is blank).
Java request handling does not accept this and throws an exception; Since Salesforce doesn't handle low-level Java exceptions it is impossible to handle authentication responses with empty WWW-Authentication headers.
A discussion around this issue handling empty WWW-Authentication headers: http://cxf.547215.n5.nabble.com/jira-Created-CXF-4318-OAuthRequestFilter-generates-an-empty-WWW-Authenticate-header-td5707908.html
What I would like to know is:
- Get in touch with someone from the EOL API team to fix this bug
- Is there anyone who knows how to handle a Java exception in Apex