Download the PHP package equipe-web/laravel-keycloak without Composer

On this page you can find all versions of the php package equipe-web/laravel-keycloak. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-keycloak

TCEMT KEYCLOAK

Instalação

Requerimentos

Instale o componente via comando do composer:

Configuração

Abra o arquivo bootstrap/providers.php e adicione na lista de providers:

limpe o cache de configurações

Edite o arquivo .env e adicione a configuração básicas para o componente de segurança:

Adicione as configurações do KeyCloak no arquivo config/services.php:

limpe o cache de configurações novamente

Execute os comandos abaixo:

Utilização

Links para login e logout via Oauth2

O ServiceProvider desta biblioteca automaticamente irá registrar as seguintes rotas para o processo de autenticação:

Diretivas Blade para gerar os links de login/logout

Dentro do template blade você pode utilizar a diretiva @keycloak_login_url($label, $css) e @keycloak_logout_url($label, $css) para gerar os links de login e logout respectivamente.

Exemplo:

Se você utilizar a diretiva de logout, o usuário será redirecionado para a tela de logout do KeyCloak e depois será redirecionado para a URL de logout da sua aplicação. Dessa forma, ao efetuar o logout a sessão do usuário será encerrada nas duas aplicações. Caso você queira que o usuário seja desconectado apenas da sua aplicação e mantenha a sessão autenticada no KeyClock (para logar novamente sem precisar redigitar o login/senha) você deve utilizar a rota auth.logout ao invés da diretiva:

Dentro de um Controller

Utilize o facade Gate para verificar as permissões dos usuários no controller. O método Gate::allows($recurso) se encarrega de fazer a verificação e retorna verdadeiro ou falso.

Uso em templates do Blade


All versions of laravel-keycloak with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4|^8.3
laravel/framework Version ^12.0
firebase/php-jwt Version ^6.10
laravel/socialite Version ^5.16
socialiteproviders/keycloak Version ^5.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package equipe-web/laravel-keycloak contains the following files

Loading the files please wait ....