# Quick start Once the library has been [installed](installation.md), you are able to issue and parse JWTs. The class `Lcobucci\JWT\JwtFacade` is the quickest way to perform these operations. Using that facade we also aim to make sure that every token is properly signed and has the recommended claims for date control. ## Issuing tokens The method `Lcobucci\JWT\JwtFacade#issue()` is available for quickly creating tokens. It uses the current time to generate the date claims (default expiration is **5 minutes**). To issue a token, call the method passing: an algorithm, a key, and a customisation function: ```php issue( new Sha256(), $key, static fn ( Builder $builder, DateTimeImmutable $issuedAt ): Builder => $builder ->issuedBy('https://api.my-awesome-app.io') ->permittedFor('https://client-app.io') ->expiresAt($issuedAt->modify('+10 minutes')) ); var_dump($token->claims()->all()); echo $token->toString(); ``` ### Creating tokens during tests To reduce the chance of having flaky tests on your test suite, the facade supports the usage of a clock object. That allows passing an implementation that always returns the same point in time. You can achieve that by specifying the `clock` constructor parameter: ```php issue( new Sha256(), $key, static fn ( Builder $builder, DateTimeImmutable $issuedAt ): Builder => $builder ); echo $token->claims()->get( RegisteredClaims::ISSUED_AT )->format(DateTimeImmutable::RFC3339); // 2022-06-24 22:51:10 ``` ## Parsing tokens The method `Lcobucci\JWT\JwtFacade#parse()` is the one for quickly parsing tokens. It also verifies the signature and date claims, throwing an exception in case of tokens in unexpected state. ```php parse( $jwt, new Constraint\SignedWith(new Sha256(), $key), new Constraint\StrictValidAt( new FrozenClock(new DateTimeImmutable('2022-07-24 20:55:10+00:00')) ) ); var_dump($token->claims()->all()); ``` !!! Warning The example above uses `FrozenClock` as clock implementation to make sure that code will always work. Use `SystemClock` on the production code of your application, allowing the parser to correctly verify the date claims.