Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Session Cookies #244

Closed
wants to merge 4 commits into from
Closed

Conversation

jeromegamez
Copy link
Member

Addresses #202

Todo

  • Add functionality to create a session cookie
  • Add functionality to verify a session cookie
  • Write tests
  • Write documentation

:octocat:

@Ritcheyy
Copy link

Ritcheyy commented Dec 4, 2018

Please is there any doc on how to use this yet?

@jeromegamez jeromegamez force-pushed the feature/session-cookies branch from 9a424d0 to 54195c8 Compare December 21, 2018 11:57
if ($this->idTokenVerifier instanceof NewIdTokenVerifier) {
try {
$this->idTokenVerifier->verify($idToken);
} catch (Exception\InvalidToken $e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this catch InvalidToken hidden away exception message from inside verifier

for example, expired idToken will be thrown by verifyExpiry with message 'The token is expired since xxx'
with this too broad catch, will result in new InvalidToken without message from line 371

@@ -58,7 +57,7 @@ public function getResponse()

private static function getTargetClassFromStatusCode($code): string
{
if (\in_array($code, [StatusCode::STATUS_UNAUTHORIZED, StatusCode::STATUS_FORBIDDEN], true)) {
if (\in_array($code, [401, 403], true)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason to remove the usage of the constants?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been quite some time, but I probably wanted to remove the transient dependency on the fig/http-message-util package (which is available through the inclusion of kreait/firebase-tokens). Removing that package would break this class.

I'm currently planning on a rework of both packages, so the issue might or might not apply in the future any more.

@jeromegamez
Copy link
Member Author

Postponed to after 5.0

@jeromegamez jeromegamez deleted the feature/session-cookies branch March 15, 2019 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants