定制 autokz/oauth_proxy 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

autokz/oauth_proxy

Composer 安装命令:

composer require autokz/oauth_proxy

包简介

Proxy server for Auth with JWT

README 文档

README

alt text

Init

<?php

$converter = new JWTConverter();

$configStorage = new DotEnvConfigStorage(__DIR__ . '/../'); // Path to .env file
$configStorage->load();

// Optional variable - Http client
$httpClient = new CurlHttpClient();

Create Proxy

$proxy = new Proxy($converter, $configStore, $httpClient);

Methods

// Login
$username = new UsernameType('username');
$password = new PasswordType('password');
$oAuthData = $proxy->login($username, $password); // string|Exception 

// Logout
$oAuthData = 'crypted_and_converted_access_token_array_to_string';
$proxy->logout($oAuthData); // true|Exception

// Check
$oAuthData = 'crypted_and_converted_access_token_array_to_string';
$oAuthData = $proxy->check($oAuthData); // string|Exception

// Refresh
$oAuthData = 'crypted_and_converted_refresh_token_array_to_string';
$oAuthData = $proxy->refresh($oAuthData); // string|Exception

.env example

OAUTH_BASE_URL="http://0.0.0.0:8080"

OAUTH_TYPE="Bearer"

OAUTH_URL="oauth/auth"
OAUTH_CHECK_URL="oauth/user/check"
OAUTH_LOGOUT_URL="oauth/user/logout"

OAUTH_GRANT_TYPE="password_domain"
OAUTH_REFRESH_GRANT_TYPE="refresh_domain"
OAUTH_DOMAIN="test.com"

OAUTH_CLIENT_ID="app"
OAUTH_CLIENT_SECRET=""
OAUTH_ACCESS_TYPE="offline"

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2021-01-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固