jaburjak/oauth2-zuul

FIT CTU Zuul Provider for the PHP League’s OAuth 2.0 Client.

v1.0.0 2024-02-04 17:31 UTC

This package is auto-updated.

Last update: 2024-05-22 12:28:00 UTC


README

This package provides FIT CTU OAuth 2.0 support for the PHP League’s OAuth 2.0 Client.

Requirements

Requires PHP version 7.4 or newer and The League’s OAuth 2.0 Client version 2.

To be able to authenticate users via the FIT CTU Identity Provider, you must create a Client ID and a Client Secret for your application. Follow the official instructions (in Czech) to obtain them.

Installation

Use Composer to install:

$ composer require jaburjak/oauth2-zuul

Usage

The usage is the same as The League’s OAuth client, using \OAuth2Zuul\Provider\Zuul as the provider. For examples, refer to The League’s documentation.

$provider = new OAuth2Zuul\Provider\Zuul([
	'clientId'     => '<zuul-client-id>',
	'clientSecret' => '<zuul-client-secret>',
	'redirectUri'  => 'https://example.com/callback-url',
	// optional
	'scopes'       => ['cvut:umapi:read'],
	// optional, value here is the default
	'base_url'     => 'https://auth.fit.cvut.cz'
]);

Sample project

An opinionated sample project using this package, based on the Symfony framework, showcasing user authentication and accessing CTU APIs, and featuring detailed description of its implementation, is available in the sample subdirectory.

Credits

Support

If you find a bug or encounter any issue, please file an issue.

License

The MIT License (MIT). Please see License File for more information.