Download the PHP package klsoft/yii2-keycloak-authz without Composer
On this page you can find all versions of the php package klsoft/yii2-keycloak-authz. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download klsoft/yii2-keycloak-authz
More information about klsoft/yii2-keycloak-authz
Files in klsoft/yii2-keycloak-authz
Download klsoft/yii2-keycloak-authz
More information about klsoft/yii2-keycloak-authz
Files in klsoft/yii2-keycloak-authz
Vendor klsoft
Package yii2-keycloak-authz
Short Description The package provides Keycloak authorization for the web service APIs of Yii 2.
License MIT
Homepage https://github.com/klsoft-web/yii2-keycloak-authz
Package yii2-keycloak-authz
Short Description The package provides Keycloak authorization for the web service APIs of Yii 2.
License MIT
Homepage https://github.com/klsoft-web/yii2-keycloak-authz
Please rate this library. Is it a good library?
Informations about the package yii2-keycloak-authz
YII2-KEYCLOAK-AUTHZ
The package provides Keycloak authorization for the web service APIs of Yii 2.
See also:
- YII2-JWT-AUTH - The package provides a Yii 2 authentication method based on a JWT token
- PHP-KEYCLOAK-CLIENT - A PHP library that can be used to secure web applications with Keycloak
Requirement
- PHP 8.0 or higher.
Installation
How does it work
- A client requests a protected web service API method using an access token.
- The web service checks whether the access token contains the necessary permissions. If permissions exist, proceed to step 6.
- The web service obtains a permission ticket using the access token and the permissions of the API method. It then responds with the permission ticket:
HTTP/1.1 401 Unauthorized WWW-Authenticate: UMA realm="realm name", as_uri="realm URI", ticket="permission ticket" - The client obtains a Requesting Party Token (RPT) using the access token and the permission ticket.
- The client requests a protected web service API method with the RPT.
- The web service checks the RPT permissions. If the RPT has the necessary permissions, the request is passed to the next ActionFilter or action. Otherwise, HTTP/1.1 403 Forbidden is returned
How to use
1. Implement Klsoft\Yii2KeycloakAuthz\KeycloakRepositoryInterface
Example:
2. Add the realm and the realm URI to param.php
Example:
3. Register dependencies
Example of registering dependencies using the application configuration:
4. Apply permissions.
4.1. Configure the authorization behavior and apply permissions to an action
Example:
Example of a permission with claims:
Example of a permission with an executing claim value:
4.2. Configure the authorization behavior and apply permissions to a controller
Example:
All versions of yii2-keycloak-authz with dependencies
PHP Build Version
Package Version
The package klsoft/yii2-keycloak-authz contains the following files
Loading the files please wait ...