Skip to content

JwtBearerTest

  • Full name: \OAuth2\GrantType\JwtBearerTest
  • Parent class: TestCase

Properties

privateKey

private $privateKey

Methods

setUp

public setUp(): void

testMalformedJWT

public testMalformedJWT(): mixed

testBrokenSignature

public testBrokenSignature(): mixed

testExpiredJWT

public testExpiredJWT(): mixed

testBadExp

public testBadExp(): mixed

testNoAssert

public testNoAssert(): mixed

testNotBefore

public testNotBefore(): mixed

testBadNotBefore

public testBadNotBefore(): mixed

testNonMatchingAudience

public testNonMatchingAudience(): mixed

testBadClientID

public testBadClientID(): mixed

testBadSubject

public testBadSubject(): mixed

testMissingKey

public testMissingKey(): mixed

testValidJwt

public testValidJwt(): mixed

testValidJwtWithScope

public testValidJwtWithScope(): mixed

testValidJwtInvalidScope

public testValidJwtInvalidScope(): mixed

testValidJti

public testValidJti(): mixed

testInvalidJti

public testInvalidJti(): mixed

testJtiReplayAttack

public testJtiReplayAttack(): mixed

getJWT

Generates a JWT

private getJWT(mixed $exp = null, mixed $nbf = null, mixed $sub = null, mixed $iss = 'Test Client ID', mixed $jti = null): string

Parameters:

Parameter Type Description
$exp mixed The expiration date. If the current time is greater than the exp, the JWT is invalid.
$nbf mixed The "not before" time. If the current time is less than the nbf, the JWT is invalid.
$sub mixed The subject we are acting on behalf of. This could be the email address of the user in the system.
$iss mixed The issuer, usually the client_id.
$jti mixed

getTestServer

private getTestServer(mixed $audience = 'http://myapp.com/oauth/auth'): mixed

Parameters:

Parameter Type Description
$audience mixed


Automatically generated on 2025-03-18