-
-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create the signature when retrieving the token
- Loading branch information
Showing
12 changed files
with
156 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,7 @@ public function builderShouldRaiseExceptionWhenKeyIsInvalid() | |
->canOnlyBeUsedBy('http://client.abc.com') | ||
->issuedBy('http://api.abc.com') | ||
->with('user', ['name' => 'testing', 'email' => '[email protected]']) | ||
->sign($this->config->getSigner(), new Key('testing')); | ||
->getToken($this->config->getSigner(), new Key('testing')); | ||
} | ||
|
||
/** | ||
|
@@ -93,7 +93,7 @@ public function builderShouldRaiseExceptionWhenKeyIsNotEcdsaCompatible() | |
->canOnlyBeUsedBy('http://client.abc.com') | ||
->issuedBy('http://api.abc.com') | ||
->with('user', ['name' => 'testing', 'email' => '[email protected]']) | ||
->sign($this->config->getSigner(), static::$rsaKeys['private']); | ||
->getToken($this->config->getSigner(), static::$rsaKeys['private']); | ||
} | ||
|
||
/** | ||
|
@@ -122,8 +122,7 @@ public function builderCanGenerateAToken() | |
->issuedBy('http://api.abc.com') | ||
->with('user', $user) | ||
->withHeader('jki', '1234') | ||
->sign($this->config->getSigner(), static::$ecdsaKeys['private']) | ||
->getToken(); | ||
->getToken($this->config->getSigner(), static::$ecdsaKeys['private']); | ||
|
||
self::assertAttributeInstanceOf(Signature::class, 'signature', $token); | ||
self::assertEquals('1234', $token->headers()->get('jki')); | ||
|
@@ -317,8 +316,7 @@ public function everythingShouldWorkWithAKeyWithParams() | |
->issuedBy('http://api.abc.com') | ||
->with('user', ['name' => 'testing', 'email' => '[email protected]']) | ||
->withHeader('jki', '1234') | ||
->sign($signer, static::$ecdsaKeys['private-params']) | ||
->getToken(); | ||
->getToken($signer, static::$ecdsaKeys['private-params']); | ||
|
||
$constraint = new SignedWith( | ||
$this->config->getSigner(), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
|
||
use Lcobucci\JWT\Configuration; | ||
use Lcobucci\JWT\Keys; | ||
use Lcobucci\JWT\Signer; | ||
use Lcobucci\JWT\Signer\Key; | ||
use Lcobucci\JWT\Signer\Rsa\Sha256; | ||
use Lcobucci\JWT\Signer\Rsa\Sha512; | ||
|
@@ -63,7 +62,7 @@ public function builderShouldRaiseExceptionWhenKeyIsInvalid() | |
->canOnlyBeUsedBy('http://client.abc.com') | ||
->issuedBy('http://api.abc.com') | ||
->with('user', ['name' => 'testing', 'email' => '[email protected]']) | ||
->sign($this->config->getSigner(), new Key('testing')); | ||
->getToken($this->config->getSigner(), new Key('testing')); | ||
} | ||
|
||
/** | ||
|
@@ -88,7 +87,7 @@ public function builderShouldRaiseExceptionWhenKeyIsNotRsaCompatible() | |
->canOnlyBeUsedBy('http://client.abc.com') | ||
->issuedBy('http://api.abc.com') | ||
->with('user', ['name' => 'testing', 'email' => '[email protected]']) | ||
->sign($this->config->getSigner(), static::$ecdsaKeys['private']); | ||
->getToken($this->config->getSigner(), static::$ecdsaKeys['private']); | ||
} | ||
|
||
/** | ||
|
@@ -113,8 +112,7 @@ public function builderCanGenerateAToken() | |
->issuedBy('http://api.abc.com') | ||
->with('user', $user) | ||
->withHeader('jki', '1234') | ||
->sign($this->config->getSigner(), static::$rsaKeys['private']) | ||
->getToken(); | ||
->getToken($this->config->getSigner(), static::$rsaKeys['private']); | ||
|
||
self::assertAttributeInstanceOf(Signature::class, 'signature', $token); | ||
self::assertEquals('1234', $token->headers()->get('jki')); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.