lyseontech/drupal-external-auth
Composer 安装命令:
composer require lyseontech/drupal-external-auth
包简介
External authenticator user into Drupal
关键字:
README 文档
README
Drupal External Auth
Composer package to externally authenticate Drupal users
If the user exists in Drupal, authenticates the user.
If the user does not exist in Drupal, it creates the user and authenticates.
How to use?
composer require lyseontech/drupal-external-auth
Login
$response = new Response(); $pdo = new PDO(...); (new \DrupalExternalAuth\Auth($response, $pdo))->auth([ 'name' => 'username', 'pass' => 'PrefixHash$' . 'hashOfPassord', 'timezone' => 'America/Sao_Paulo', 'langcode' => 'pt-br', 'roles' => ['administrator'] ]); foreach ($response->headers->getCookies() as $cookie) { header('Set-Cookie: '.$cookie->getName().strstr($cookie, '=')); }
In PrefixHash, put the prefix hash to identify the hash password from your system.
In hashPassord put the hash for user, if don't is necessary the user authenticate in Drupal by default login page of Drupal, put anything in this field.
If you dont implement custom validation hash in Drupal, the user can only access Drupal through your system.
Logout
$response = new Response(); $pdo = new PDO(...); (new \DrupalExternalAuth\Auth($response, $pdo))->logout(); foreach ($response->headers->getCookies() as $cookie) { header('Set-Cookie: '.$cookie->getName().strstr($cookie, '=')); }
统计信息
- 总下载量: 52
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-04-08