-
-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Describe the bug
I am using Auth 1.0.38 in a Craft 4 project for a Dynamics365 integration.
I have the connection to Dynamics successfully set up and a token stored in the database.
Whilst the token is still valid, all API calls work as expected.
Once the access token has expired, the next API call refreshes the token successfully, however, then when the API call is attempted, it fails with a 400 Bad Request error and the following message:
Bad Request - Invalid Header
HTTP Error 400. The request has an invalid header name.
Subsequent API calls work as expected until the access token expires again and the same behaviour happens again.
I enabled debug and stepped through an API call for an expired access token and noticed that immediately after the access token had been refreshed, the Authorization header was being set to an array with two identical members, instead of a string. This appears to be happening in the createRequest() method in the AbstractProvider.php` file.
Steps to reproduce
- Set up connection to Dynamics365
- Wait for access token to expire
- Make a new API request
- The token will be refreshed and the API request will fail as the Authorization header is now an array instead of a string.
- Subsequent API calls will succeed until the access token expires again.
Craft CMS version
4.15.3
Plugin version
1.0.38
Multi-site?
No
Additional context
No response