Download the PHP package lovenery/lightopenid without Composer
On this page you can find all versions of the php package lovenery/lightopenid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package lightopenid
I fork form https://github.com/iignatov/LightOpenID
and translate it readability for chinese users
LightOpenID
輕量的OpenID認證library(PHP5)
版本:
1.3.1 :arrow_double_down: ( 看 原作者的改版日誌 更詳細 )發佈於:
2016年 3月4號作者的原始碼:
Official GitHub Repo :octocat:作者:
Mewp
快速開始
加到 composer.json
composer require lovenery/lightopenid
或
兩個步驟 登入 OpenID :
-
(Authentication)認證使用provider:
The provider then sends various parameters via GET, one of which is
openid_mode
. - (Verification)驗證是否成功:
註:
變更 'my-host.example.org' 變更成你的 domain name. 不要用 $_SERVER['HTTP_HOST']
除非你知道自己在幹麻
選擇性地, 你可以設定 $returnUrl
和 $realm
(或 $trustRoot
, which is an alias).
程式的初始值是以下:
也支援 AX and SREG extensions:
在呼叫 $openid->authUrl()
之前, 只需要設定 $openid->required
and/or $openid->optional
裡面都是放array,內容是 AX schema paths
(path是網址的一部份). 例如:
取得你要得數值:
基本設定選項詳細(可略):
名字 | 詳細 |
---|---|
identity | Sets (or gets) the identity supplied by an user. Set it before calling authUrl(), and get after validate(). |
returnUrl | Users will be redirected to this url after they complete authentication with their provider. Default: current url. |
realm | The realm user is signing into. Providers usually say "You are sgning into $realm". Must be in the same domain as returnUrl. Usually, this should be the host part of your site's url. And that's the default. |
required and optional | Attempts to fetch more information about an user. See Common AX attributes. |
verify_peer | When using https, attempts to verify peer's certificate. See CURLOPT_SSL_VERIFYPEER. |
cainfo and capath | When verify_peer is true, sets the CA info file and directory. See CURLOPT_SSL_CAINFO and CURLOPT_SSL_CAPATH. |
Common AX attributes (可略)
Here is a list of the more common AX attributes (from [axschema.org](http://www.axschema.org/types/)):
Name | Meaning
------------------------|---------------
namePerson/friendly | Alias/Username
contact/email | Email
namePerson | Full name
birthDate | Birth date
person/gender | Gender
contact/postalCode/home | Postal code
contact/country/home | Country
pref/language | Language
pref/timezone | Time zone
Note that even if you mark some field as required, there is no guarantee that you'll get any
information from a provider. Not all providers support all of these attributes, and some don't
support these extensions at all.
Google, for example, completely ignores optional parameters, and for the required ones, it supports,
according to [it's website](http://code.google.com/apis/accounts/docs/OpenID.html):
* namePerson/first (first name)
* namePerson/last (last name)
* contact/country/home
* contact/email
* pref/language