Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
PHP Dotenv
Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
-
http-message
The purpose of this PSR is to provide a set of common interfaces for HTTP messages as described in RFC 7230 and RFC 7231
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I put together this sample project, which leverages two libraries created by The PHP League and will be discussed in the following sections of this article. If you want to follow along, go ahead and clone the repository.
For the client side, I'll be using the library league/oauth2-client.
Here, I'm using the vlucas/phpdotenv library to process .env files.
Since the library is designed to be easily integrated with different frameworks, it relies on the usage of PSR-7 compliant HTTP messages. To fulfill this requirement, I'll be using the nyholm/psr7 package.
Since the library is designed to be easily integrated with different frameworks, it relies on the usage of PSR-7 compliant HTTP messages. To fulfill this requirement, I'll be using the nyholm/psr7 package.
I put together this sample project, which leverages two libraries created by The PHP League and will be discussed in the following sections of this article. If you want to follow along, go ahead and clone the repository.
For the server side, I'll use the OAuth 2.0 server library. The implementation here is more complex, as there are many moving parts that need to be in place.
Related posts
- Best social login library for PHP ("sign in with Apple/Google/Facebook" etc.)?
- Best social login library for PHP ("sign in with Apple/Google/Facebook" etc.)?
- Looking for PHP classes that will authenticate against existing OAuth or SAML IdP servers
- Mobile application using website's PHP OAuth
- Looking for low security and simple login ideas.