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

PSR-7 support #1099

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

tobias-trozowski
Copy link

Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change? Yes
Minor: New Feature? Yes

Breaking Change:
Changed signature of Hybridauth\Adapter\AdapterInterface::authenticate so it accepts a Psr\Http\Message\ServerRequestInterface $request = null.

Description:
Changed adapters (OpenID, OAuth1, OAuth2) accordingly to new method signature.
If a $request !== null is passed to Hybridauth\Adapter\AdapterInterface::authenticate it will return a RedirectResponse which can than be handled separately.

Allows easy integration into all PSR-15 applications.
Also solves a bug when using custom session handlers like zendframework/zend-expressive-session or psr7-sessions/storageless where sessions are persisted at the end of the execution chain (which is after ::authenticateBegin is called where a redirect is forced).

@StorytellerCZ
Copy link
Contributor

Given that this is a breaking change, then this will be for HybridAuth v4.0

@StorytellerCZ StorytellerCZ added this to the 4.x milestone Aug 20, 2019
@zorn-v
Copy link
Contributor

zorn-v commented Aug 1, 2020

Zend framework is laminas now. Maybe change dependency to actual laminas/laminas-diactoros ?
Or do not use it at all ?

@tobias-trozowski
Copy link
Author

@zorn-v migrating to laminas seems to be an great idea!
if you know some lightweight alternatives for Zend\Diactoros\Response\RedirectResponse and Zend\Diactoros\ServerRequestFactory feel free to suggest something and I will have a look into it.

# Conflicts:
#	composer.json
#	src/Adapter/AdapterInterface.php
#	src/Adapter/OAuth1.php
#	src/Adapter/OAuth2.php
#	src/Adapter/OpenID.php
#	src/Provider/PaypalOpenID.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants