opauth/linkedin

Opauth 的 LinkedIn 策略

0.3.0 2020-01-06 15:12 UTC

This package is auto-updated.

Last update: 2024-09-07 01:13:03 UTC


README

Opauth 的 LinkedIn 策略,基于 OAuth 2.0 实现,参考 https://developer.linkedin.com/documents/authentication

Opauth 是一个适用于 PHP 的多认证提供者框架。

演示: http://opauth.org#linkedin

入门

  1. 安装 Opauth-LinkedIn

    cd path_to_opauth/Strategy
    git clone git://github.com/opauth/linkedin.git LinkedIn

    composer require opauth/linkedin
  2. https://www.linkedin.com/secure/developer 创建 LinkedIn 应用程序

    • 在 JavaScript API Domain 中输入您的域名
    • 无需输入 OAuth 重定向 URL
  3. 使用至少 qpi_keysecret_key 配置 Opauth-LinkedIn 策略。

  4. 将用户直接导向 http://path_to_opauth/linkedin 进行认证

策略配置

必需参数

<?php
'LinkedIn' => array(
	'api_key' => 'YOUR API KEY',
	'secret_key' => 'YOUR SECRET KEY'
),

注意:若要获取电子邮件,请在 scope 中包含 r_emailaddress,例如:'scope' => 'r_basicprofile r_emailaddress'

有关更多可选参数,请参阅 LinkedInStrategy.php。

许可证

Opauth-LinkedIn 采用 MIT 许可证,版权所有 © U-Zyn Chua (http://uzyn.com)