Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
extracted server config from verifier, unit tested all the things
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrl-f5 committed Nov 17, 2020
1 parent 3768fa5 commit b9f37ac
Show file tree
Hide file tree
Showing 29 changed files with 1,307 additions and 473 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ FROM php:7.2-cli-stretch

COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

RUN apt-get update
RUN apt-get install -y zip git

RUN pecl install xdebug-2.9.8 && docker-php-ext-enable xdebug

COPY . /app
WORKDIR /app

Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ To validate a JWT, you will need a few different items:
require_once("/vendor/autoload.php"); // This should be replaced with your path to your vendor/autoload.php file

$jwtVerifier = (new \Okta\JwtVerifier\JwtVerifierBuilder())
->setDiscovery(new \Okta\JwtVerifier\Discovery\Oauth) // This is not needed if using oauth. The other option is `new \Okta\JwtVerifier\Discovery\OIDC`
->setAdaptor(new \Okta\JwtVerifier\Adaptors\FirebasePhpJwt)
->setDiscovery(new \Okta\JwtVerifier\Server\Discovery\Oauth) // This is not needed if using oauth. The other option is `new \Okta\JwtVerifier\Server\Discovery\OIDC`
->setAdaptor(new \Okta\JwtVerifier\Adaptor\FirebasePhpJwt)
->setAudience('api://default')
->setClientId('{clientId}')
->setIssuer('https://{yourOktaDomain}.com/oauth2/default')
Expand Down Expand Up @@ -87,8 +87,6 @@ The result from the verify method is a `Jwt` object which has a few helper metho
```php
dump($jwt); //Returns instance of \Okta\JwtVerifier\JWT

dump($jwt->toJson()); // Returns Claims as JSON Object

dump($jwt->getClaims()); // Returns Claims as they come from the JWT Package used

dump($jwt->getIssuedAt()); // returns Carbon instance of issued at time
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"Okta\\JwtVerifier\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Test\\": "tests/"
}
},
"require": {
"php": "^7.2",
"ext-json": "*",
Expand All @@ -27,7 +32,7 @@
"bretterer/iso_duration_converter": "^0.1.0"
},
"require-dev": {
"phpunit/phpunit": "^7.0 ",
"phpunit/phpunit": "^8.0 ",
"symfony/var-dumper": "^5.1",
"squizlabs/php_codesniffer": "^3.5",
"php-http/mock-client": "^1.4",
Expand Down
Loading

0 comments on commit b9f37ac

Please sign in to comment.