Authentication
Token Authentication
"Authorization": "Bearer my-authentication-token"<?php
$request = new GetForgeServerRequest(serverId: 123456);
$request->withTokenAuth('my-token');
$response = $request->send();Default Authentication
<?php
use Sammyjo20\Saloon\Http\Auth\TokenAuthenticator;
class GetForgeServerRequest extends SaloonRequest
{
// ...
public function defaultAuth(): ?AuthenticatorInterface
{
return new TokenAuthenticator('username', 'password');
}
}Basic Authentication
Default Authentication
Digest Authentication
Default Authentication
Creating your own authenticators
Authenticators
Example Authenticator
Using your authenticator
Default authenticator
OAuth2 Authentication
Last updated