Here is the doc for Basic Auth with php:
https://www.php.net/manual/en/features.http-auth.php
But how to use Bearer Auth with php? I googled and found no info. Plz help.
Server or client?
What you posted is the server-side, so when receiving credentials.
For sending credentials, so logging in with PHP into another website, use CURL. You find many references on a search like “php curl bearer”.
The bearer token is included in the header of the request. Here is an example using curl.
Thanks. Here is my code: Bit.ly api v4 authentication
But I am not getting the authorization header at target. Did I do any mistake or does it require a particular extension or module in order to set/get authorization bearer?
@zee
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.