oclockdev/keycloak-jwt-guard 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

oclockdev/keycloak-jwt-guard

最新稳定版本:v1.1.1

Composer 安装命令:

composer require oclockdev/keycloak-jwt-guard

包简介

A library to decode JWT provided by Keycloak

README 文档

README

A library to decode JWT provided by Keycloak

How to use?

<?php

use Oclockdev\KeycloakJwtGuard\Guard\KeycloakGuard;

require_once "./vendor/autoload.php";


// Get the bearer token from the request
$accessToken = $_SERVER['HTTP_AUTHORIZATION'];

// Create a new instance of KeycloakGuard with Keycloak server info
$keycloakGuard = new KeycloakGuard([
    "serverUrl" => "https://localhost:8080",
    "realm"     => "master",
    "accessToken" => $accessToken
]);

// Authenticate with the access token and return the JWT payload
$payload = $keycloakGuard->authenticate();

// Call the userinfo keycloak endpoint with the access token
$userinfo = $keycloakGuard->getOwnerRessource();

统计信息

  • 总下载量: 300
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-11