danger2k7/cakephp-soap-auth 问题修复 & 功能扩展

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

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

danger2k7/cakephp-soap-auth

最新稳定版本:1.0

Composer 安装命令:

composer require danger2k7/cakephp-soap-auth

包简介

CakePHP plugin for authenticating for stateless connexions

README 文档

README

License

Plugin containing AuthComponent's authenticate class for authenticating using headers.

Requirements

  • CakePHP 3.5+

Installation

composer require dynweb-org/cakephp-soap-auth

Usage

In your app's config/bootstrap.php add:

// In config/bootstrap.php
Plugin::load('Dynweb/SoapAuth');

or using cake's console:

./bin/cake plugin load Dynweb/SoapAuth

Configuration:

Setup AuthComponent:

    // In your controller, for e.g. src/Api/AppController.php

Working

The authentication class checks for the token in two locations:

  • HTTP_AUTHORIZATION environment variable:

    It first checks if token is passed using Authorization request header. The value should be of form Bearer <token>. The Authorization header name and token prefix Bearer can be customzied using options header and prefix respectively.

    Note: Some servers don't populate $_SERVER['HTTP_AUTHORIZATION'] when Authorization header is set. So it's upto you to ensure that either $_SERVER['HTTP_AUTHORIZATION'] or $_ENV['HTTP_AUTHORIZATION'] is set.

    For e.g. for apache you could use the following:

    RewriteEngine On
    RewriteCond %{HTTP:Authorization} ^(.*)
    RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
    
  • The query string variable specified using parameter config:

    Next it checks if the token is present in query string. The default variable name is token and can be customzied by using the parameter config shown above.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-05-16