Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ This package uses the PHP League's [OAuth2 Client](https://github.com/thephpleag
The following versions of PHP are supported.

* PHP 7.4
* PHP 8.0 (coming soon, needs use `lcobucci\jwt:v4.1`)
* PHP 8.0
* PHP 8.1

## Usage
You may test your OpenID Connect Client against [bshaffer's demo oauth2 server](https://github.com/bshaffer/oauth2-demo-php).
Expand All @@ -17,16 +18,24 @@ $signer = new \Lcobucci\JWT\Signer\Rsa\Sha256();
$provider = new \OpenIDConnectClient\OpenIDConnectProvider([
'clientId' => 'demoapp',
'clientSecret' => 'demopass',
// the issuer of the identity token (id_token) this will be compared with what is returned in the token.
'idTokenIssuer' => 'brentertainment.com',
// Your server
'redirectUri' => 'http://example.com/your-redirect-url/',

// Settings of the OP (OpenID provider)
// The issuer of the identity token (id_token) this will be compared with what is returned in the token.
'idTokenIssuer' => 'brentertainment.com',
'urlAuthorize' => 'http://brentertainment.com/oauth2/lockdin/authorize',
'urlAccessToken' => 'http://brentertainment.com/oauth2/lockdin/token',
'urlResourceOwnerDetails' => 'http://brentertainment.com/oauth2/lockdin/resource',
// Find the public key here: https://github.com/bshaffer/oauth2-demo-php/blob/master/data/pubkey.pem
// to test against brentertainment.com
'publicKey' => 'file:///myproj/data/public.key',
'publicKey' => 'file:///myproj/data/public.key',

// Alternatively, you can use automatic discovery as long as your server
// has the <issuer>/.well-known/openid-configuration endpoint.
// This endpoint will then provide all provider settings above, so you only need to provide
// your own clientId, clientSecret, and redirectUri.
'issuer' => 'http://example.com/oauth2'
],
[
'signer' => $signer
Expand Down
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
],
"require": {
"php": ">= 7.4",
"lcobucci/jwt": "^3.4",
"codercat/jwk-to-pem": "^1.1",
"lcobucci/jwt": "~4.0",
"league/oauth2-client": "^2.0",
"webmozart/assert": "^1.10"
},
"require-dev": {
"ext-json": "*",
"dg/bypass-finals": "^1.3",
"enlightn/security-checker": "^1.9",
"ergebnis/composer-normalize": "^2.15",
Expand All @@ -25,6 +27,11 @@
"roave/security-advisories": "dev-master",
"squizlabs/php_codesniffer": "^3.6"
},
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true
}
},
"autoload": {
"psr-4": {
"OpenIDConnectClient\\": "src/"
Expand Down
Loading