league/openid-connect-claims

OpenID Connect ID claims 集合实现

1.1.0 2016-05-26 14:29 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:20:04 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

OpenID Connect claims 集合实现 [链接]

安装

通过 Composer

$ composer require league/openid-connect-claims

使用方法

$claims = new \League\OpenIdConnectClaims\ClaimsSet();
$claims->setIdentifier(123);
$claims->setFirstName('Alex');
$claims->setLastName('Bilbie');
$claims->setNickname('Alex');
$claims->setUsername('alexbilbie');
$claims->setProfileUrl('http://twitter.com/alexbilbie');
$claims->setPictureUrl('https://s.gravatar.com/avatar/14902eb1dac66b8458ebbb481d80f0a3');
$claims->setWebsite('http://alexbilbie.com');
$claims->setEmail('[email protected]');
$claims->setEmailVerified(true);
$claims->setGender('male');
$claims->setBirthDate('YYYY', 'MM', 'DD');
$claims->setZoneInfo('Europe/London');
$claims->setLocale('en_GB');
$claims->setPhoneNumber('0303 123 7300');
$claims->setPhoneNumberVerified(true);
$claims->setAddressStreet('Buckingham Palace');
$claims->setAddressRegion('London');
$claims->setAddressPostalCode('SW1A 1AA');
$claims->setAddressCountry('United Kingdom');

当 ClaimsSet 对象被 JSON 编码时,你会得到一个类似以下的对象

{
    "sub": "123",
    "name": "Alex Bilbie",
    "given_name": "Alex",
    "family_name": "Bilbie",
    "nickname": "Alex",
    "preferred_username": "alexbilbie",
    "profile": "http:\/\/twitter.com\/alexbilbie",
    "picture": "https:\/\/s.gravatar.com\/avatar\/14902eb1dac66b8458ebbb481d80f0a3",
    "website": "http:\/\/alexbilbie.com",
    "email": "[email protected]",
    "email_verified": true,
    "gender": "male",
    "birthdate": "YYYY-MM-DD",
    "zoneinfo": "Europe\/London",
    "locale": "en_GB",
    "phone_number": "0303 123 7300",
    "phone_number_verified": true,
    "address": {
        "street_address": "Buckingham Palace",
        "region": "London",
        "postal_code": "SW1A 1AA",
        "country": "United Kingdom"
    }
}

变更日志

请参阅 CHANGELOG 了解最近更改的信息。

测试

$ composer test

贡献

请参阅 CONTRIBUTINGCONDUCT 了解详细信息。

安全性

如果你发现任何安全相关的问题,请通过 [email protected] 发送邮件,而不是使用问题跟踪器。

致谢

许可证

MIT 许可证 (MIT)。请参阅 许可证文件 了解更多信息。