league/openid-connect-claims
![Software License][ico-license]
![Coverage Status][ico-scrutinizer]
![Total Downloads][ico-downloads], (*1)
An OpenID Connect claims set implementation, (*2)
Install
Via Composer, (*3)
``` bash
$ composer require league/openid-connect-claims, (*4)
## Usage
```php
$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('hello@alexbilbie.com');
$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');
When the ClaimsSet object is JSON encoded you will get an object similar to this:, (*5)
{
"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": "hello@alexbilbie.com",
"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"
}
}
Change log
Please see CHANGELOG for more information what has changed recently., (*6)
Testing
bash
$ composer test
, (*7)
Contributing
Please see CONTRIBUTING and CONDUCT for details., (*8)
Security
If you discover any security related issues, please email hello@alexbilbie.com
instead of using the issue tracker., (*9)
Credits
License
The MIT License (MIT). Please see License File for more information., (*10)