Closed labomatik closed 5 months ago
Maybe you could do it with a NullAuthenticator
, something like this:
class NullAuthenticator implements Authenticator
{
public function set(PendingRequest $pendingRequest): void
{
}
}
And then when you want to make the auth-free call:
$api->authenticate(new NullAuthenticator());
Hey @labomatik I have just released v3.9.0 which includes the above PR made by @patrickcarlohickman. Would you be able to try the NullAuthenticator
and see if this fixes your issue?
Hello,
Sorry for being late on this... I just validated and it seems that the nullAuthenticator doesn't erase all previous auth mechanism, the API we are using is still pinpointing an issue with a mixed auth... I added a debug just after the NullAuthenticator and i do see the oauthConfig object part of the connector
@labomatik ,
Changing the authenticator won't affect the oauthConfig
property that is already set on the connector. However, the NullAuthenticator
doesn't use this config data at all, so I think the issue is somewhere else.
Would you be able to provide the implementation for your APIConnector
connector, AttachFileToJob
request, and possibly a dump of the request actually made (with any sensitive data/ids/secrets/keys redacted).
Thanks, Patrick
Thanks @patrickcarlohickman after a review on the AttachFileToJob i just found this:
protected function defaultHeaders(): array
{
return [
'x-api-key' => config('services.api.api_key'),
//'Authorization' => null. ---> I removed this...
];
}
And now it's working :-) Thanks for the support
I would like to remove the authentication on a specific request while the connector is using OAuth
The request to the API is the following:
The last step is actually sending an error when we push to AWS "Only one auth mechanism allowed;" since we are using an API key on that step
Is there a way to remove from the connector the Authentication?