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

Fixed problem with setting Auth Adapter #125

Closed

Conversation

matwright
Copy link

Currently if any other module calls the AdapterChainFactory prior to ScnSocialAuth (for example BjyAuthorize) then the Auth Adapter defaults back to ZendDB.

See :

bjyoungblood/BjyAuthorize#208

and

#123

To fix the issue I remove any previously attached listeners for authenticate and logout and replace with HybridAuth adapter instances for those events.

As a precaution I also reset the adapter on the zfcuser_auth_service.

The outcome is the same as the previous technique of settings the Module Options on the fly (in that we enforce te HydridAuth adapter exclusively). This will overwrite any previously configured adapters.

I have tested with BjyAuthorize.

If any other module calls the AdapterChainFactory prior to ScnSocialAuth (for example BjyAuthorize) then the Auth Adapter defaults back to ZendDB. 

See :

bjyoungblood/BjyAuthorize#208

and

SocalNick#123

To fix the issue I remove any previously attached listeners for authenticate and logout and replace with HybridAuth adapter instances for those events.

As a precaution I also reset the adapter on the zfcuser_auth_service.

The outcome is the same as the previous technique of settings the Module Options on the fly (in that we enforce te HydridAuth adapter exclusively). This will overwrite any previously configured adapters.

I have tested with BjyAuthorize.
Mat Wright added 4 commits December 31, 2013 18:35
Signed-off-by: Mat Wright <mat@bstechnologies.com>
Signed-off-by: Mat Wright <mat@bstechnologies.com>
Signed-off-by: Mat Wright <mat@bstechnologies.com>
Signed-off-by: Mat Wright <mat@bstechnologies.com>
@jeffery
Copy link
Contributor

jeffery commented Jan 1, 2014

@matwright This works perfectly for me.

@matwright
Copy link
Author

@SocalNick What do I need to do to get this passing in Travis ? It is complaining about trailing spaces, I've run Zend Studio formatter as well as manually removed any spaces, etc. But it's still only passing on php 5.3.3

Travis error:

  1. src/ScnSocialAuth/Controller/UserController.php (trailing_spaces, controls_spaces)

@matwright
Copy link
Author

@jeffery glad its working for you too.

@jeffery
Copy link
Contributor

jeffery commented Jan 2, 2014

Hi @matwright There are some white spaces missing and some are unwanted. Have a look at the screenshot attached. The diff shows you which lines to change.
screen shot 2014-01-02 at 9 14 57 pm

@jeffery
Copy link
Contributor

jeffery commented Jan 2, 2014

you can download http://cs.sensiolabs.org/get/php-cs-fixer.phar and test the code with the following command:

php php-cs-fixer.phar fix -v --dry-run .

You can read more about the error codes at https://github.com/fabpot/PHP-CS-Fixer

@matwright
Copy link
Author

thanks @jeffery I'll download that and recommit with the spaces sorted.

@matwright
Copy link
Author

@jeffery That fixed it, passing all Travis builds now.

@SocalNick
Copy link
Owner

@matwright - thanks for uncovering the issue and the contribution. Give me a few days to roll it around and test it out.

@matwright
Copy link
Author

@SocalNick - happy to contribute : ) let me know if you need anything changing. The sooner bjyauthorise incompatibility can be resolved in master, the better.

@ltouro
Copy link

ltouro commented Jan 5, 2014

Edited:

Went through the same issue when enabled bjy (using doctrine).

Applied your solution and works very well.

Thanks !

@SocalNick
Copy link
Owner

Can everyone also try PR #128 as an alternative?

@ltouro
Copy link

ltouro commented Jan 10, 2014

@SocalNick Just tested PR #128 . Worked fine for me

@SocalNick
Copy link
Owner

Closed in favor of #128

@SocalNick SocalNick closed this Jan 14, 2014
gsomoza pushed a commit to gsomoza/ScnSocialAuth that referenced this pull request Mar 2, 2015
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