Yii Framework Forum: [MODULE] HybridAuth - Yii Framework Forum

Jump to content

  • (7 Pages)
  • +
  • « First
  • 5
  • 6
  • 7
  • You cannot start a new topic
  • You cannot reply to this topic

[MODULE] HybridAuth

#121 User is offline   Skylight 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 16-December 12

Posted 05 September 2013 - 01:08 PM

Hey guys,

I've recently integrated hybridauth to my yii app. It was working well until I found that sometimes (don't know when, seems to be random) It gives me the (You cannot access this page directly error) with this callback url callback?hauth.start=Facebook&hauth.time=some_int_value

I've tried anything I've found on google about this issue but it's not helping.
I must specify that I am using hybridauth on a subdomain. I've tried every possible site url on the facebook's app page and it is still giving me that error.

After further investigation I've found out that all end in the processAuthStart() method from Endpoint.php because it doesn't find Hybrid_Auth::storage()->get( "hauth_session.$provider_id.hauth_endpoint" ).
Maybe the set was lost somewhere...

Does anyone know how to solve this ? It's a bit frustrating that this error doesn't appear every time. I really cannot see why this is happening.

Thank you !
0

#122 User is offline   marvix 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 118
  • Joined: 02-August 13

Posted 08 September 2013 - 09:25 AM

Hi,

How can I assign one of the users as site admin ?

Thanks
0

#123 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 515
  • Joined: 08-August 09

Posted 09 September 2013 - 05:19 AM

View Postmarvix, on 08 September 2013 - 09:25 AM, said:

Hi,

How can I assign one of the users as site admin ?

Thanks

That's not something you do with hybrid-auth, but implementable according to any described in docs or wiki-articles way.
You may store user role in db, using hybrid-auth table or user-specific table and to check its role from there.



0

#124 User is offline   nat3863 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 01-September 13

Posted 09 September 2013 - 08:37 AM

How do I concatenate first name and last name attribute to be stored in the user table? Thanks!
0

#125 User is offline   Idan Hen 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 27-October 12
  • Location:Israel

Posted 15 October 2013 - 03:22 AM

Hello,

I am checking out social extensions for my website.
There are 2 big social branches: hybridauth, YiiAuth., hoauth

my question:
1. which one is more maintained , if at all ?
2. anyone tried to use both and have some info on which one is easier ? which one gives more options ?
3. i use yii-user , anyone had any issues with this ?

hybridauth - this installation process looks much easier , am i right ?
hoauth - also looks simple , but less options ?
0

#126 User is offline   PrplHaz4 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 108
  • Joined: 28-September 09
  • Location:Boston, MA

Posted 15 October 2013 - 07:35 AM

I beleive hoauth is more of an integrated solution (with yii-user as a complementary ext). The maintainer is a bit more active than the others as well - check out hoauth on github.

If you require a good deal of flexibility, there is a good wiki article on integrating hybridauth without any extensions that is worth looking at.

Also to note, hybridauth as a library may have a shaky future based on the author's twitter comments.
0

#127 User is offline   Mariano ArgaƱaraz 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 09-April 13

Posted 28 November 2013 - 09:59 PM

@Skylight Make sure that at login when you try to login with a provider, the "endpoint" is your hostname (the same thats configured in protected/config/haouth.php 'base_url').
If you var_dump $this->endpoint on {you ap}/protected/extensions/hoauth/hybridauth/Hybrid/Provider_Model.php at line 60, you must see the same hostname that launched the login, something like this www.skylight.com/index.php?r=user/login/oauth&hauth.done=Google
0

#128 User is offline   spyfx 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 14-March 13

Posted 26 December 2013 - 10:41 AM

Did Facebook change their API or something? Im getting everytime an error like:
Authentification failed! facebook returned an invalide user id. 

any guesses?
0

#129 User is offline   Muhammad Shahzad 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 103
  • Joined: 29-January 13
  • Location:Islamabad,Pakistan

Posted 06 February 2014 - 02:47 PM

Can I need to put 'hybridauth' library in my localhsot root?
As your code in config pointout this:

'hybridauth' => array(
				'baseUrl' => 'http://'. $_SERVER['SERVER_NAME'] . '/hybridauth',

when I echo this baseUrl,I saw this url:

http://localhost/hybridauth
and I'm getting this error when I tried to connect with facebook:

User not connected to the provider facebook.

I'm loged in my fb account also I gave id and secret in config.
0

#130 User is offline   Fire 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 56
  • Joined: 07-August 10

Posted 24 February 2014 - 01:12 AM

Hi there, how can I apply this patch? Can you tell me the steps please?

View Postvincenze, on 14 January 2013 - 05:46 PM, said:

Ok, here are my small fixes.

Step by step instructions for connecting to Facebook.
* Download the hybridauth extension.
* Extract it into the directory protected/modules/hybridauth
* Download the code for HybridAuth from http://hybridauth.sourceforge.net
* Extract it and replace the directory protected/modules/hybridauth/Hybrid with the code from hybridauth/Hybrid in it
* In protected/config/main.php add the parameter
'params' => array(
  //the duration of the user login cookie in days
  'authCookieDuration' => 365,
),

* Get your Facebook API ID and secret from http://developers.facebook.com/apps
Click on "Create New App", provide the name, then click on "Website with Facebook Login".
In the field "Site URL:" enter the URL of your website like this:
http:// YOUR_WEBSITE.com/hybridauth/default/callback?hauth.done=Facebook

* In protected/config/main.php add the parameter and paste the API ID and SECRET from Facebook.
'hybridauth' => array(
            'baseUrl' => 'http://' . $_SERVER['SERVER_NAME'] . '/hybridauth', 
            'withYiiUser' => false, // Set to true if using yii-user
            "providers" => array (  

                "Facebook" => array( 
                    "enabled" => true,
                    "keys"    => array ("id" => "FACEBOOK_API_ID", "secret" => "FACEBOOK_API_SECRET"),
                    "scope"   => "email,publish_stream", 
                    "display" => "" 
                ),
),


* Apply my fixes to the code
diff -rupN old/components/RemoteUserIdentity.php new/components/RemoteUserIdentity.php
--- old/components/RemoteUserIdentity.php	2012-07-31 20:13:00.000000000 -0700
+++ new/components/RemoteUserIdentity.php	2013-01-14 14:10:23.256614781 -0800
@@ -38,6 +38,7 @@ class RemoteUserIdentity extends CBaseUs
 		if ($adapter->isUserConnected()) {
 			$this->_adapter = $adapter;
 			$this->loginProviderIdentifier = $this->_adapter->getUserProfile()->identifier;
+                   	$this->userData = $this->_adapter->getUserProfile();
 
 			$user = HaLogin::getUser($this->loginProvider, $this->loginProviderIdentifier);
 			
diff -rupN old/controllers/DefaultController.php new/controllers/DefaultController.php
--- old/controllers/DefaultController.php	2012-07-31 20:12:30.000000000 -0700
+++ new/controllers/DefaultController.php	2013-01-14 14:12:59.488615292 -0800
@@ -111,7 +111,12 @@ class DefaultController extends Controll
 	}
 	
 	private function _loginUser($identity) {
-		Yii::app()->user->login($identity, 0);
+           	//store the cookie for longer time
+           	$duration = 10000;
+           	if (isset(Yii::app()->params['authCookieDuration'])) {
+                  $duration = 3600 * 24 * Yii::app()->params['authCookieDuration'];
+           	}
+		Yii::app()->user->login($identity, $duration);
 		$this->redirect(Yii::app()->user->returnUrl);
 	}
 
@@ -121,7 +126,13 @@ class DefaultController extends Controll

 	public function actionCallback() {
 		require dirname(__FILE__) . '/../Hybrid/Endpoint.php';
-		Hybrid_Endpoint::process();
+		try {
+	    	Hybrid_Endpoint::process();
+		} catch (Exception $e) {
+               	Yii::log("Error user logged using an external provider: " . $e->getMessage());
+            	Yii::app()->user->setFlash('hybridauth-error', "Something went wrong");
+	    	$this->redirect(Yii::app()->session['hybridauth-ref'], true);
+		}
 	}
 	
 	public function actionUnlink() {
diff -rupN old/HybridauthModule.php new/HybridauthModule.php
--- old/HybridauthModule.php    2012-07-31 19:09:14.000000000 -0700
+++ new/HybridauthModule.php    2013-01-17 14:29:12.621460767 -0800
@@ -16,10 +16,18 @@ class HybridauthModule extends CWebModul
                $this->setImport(array(
                        'hybridauth.models.*',
                        'hybridauth.components.*',
+                   	'hybridauth.controllers.*',
                ));
                require dirname(__FILE__) . '/Hybrid/Auth.php';
-           	$this->_hybridAuth = new Hybrid_Auth($this->getConfig());
-   	}
+        try {
+            //start the session
+            Yii::app()->session->open();
+            $this->_hybridAuth = new Hybrid_Auth($this->getConfig());
+        }
+        catch (Exception $e) {
+            Yii::log("HybridAuth message: " . $e->getMessage());
+            throw new CHttpException(500, "Error logging in. Did you deny?");
+        }
 
 
        public function beforeControllerAction($controller, $action) {



http://b3dmultitech.com - Delivering Education and Business through 3D Gaming Media
0

#131 User is offline   karte 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 46
  • Joined: 14-June 13
  • Location:thrissur

Posted 09 April 2014 - 04:36 AM

I want to import contact list of user?

How import contact of user using hybrid auth for provider facebook

I had searched more but i didn't find any solution.
0

#132 User is offline   Wasim Pathan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 02-October 12
  • Location:Pune

Posted 01 May 2014 - 02:55 AM

need emailaddress when login from linkedin how can i get it
Wasim Pathan.
0

#133 User is offline   amanation 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 16-May 13
  • Location:Nigeria

Posted 17 June 2014 - 11:09 AM

Google login not work when url is without www

Hi All,

I have a website with this module. I set the redirect url in my google settings starting with www. If the url is without the www, the webpage shows but trying to login with google will give a redirect url error.

Is there a way to set hybridauth to always append www when a request url does not include it?

Thanks
Yes we can!

Extension
ajaxuploader
0

#134 User is offline   Picto 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 06-January 14

Posted 22 June 2014 - 05:36 AM

Hi everyone,

This should be an easy answer for some of you as a few seem to have this working ok (hopefully!)

I have been trying for a while to get this going with facebook, I've set up the facebook app and as far as I can see i've followed the latest set of installation instructions completeley. But when I come to log in with facebook (via mysite.com/hybridauth) I just get taken to a mostly blank page titled 'Hybridauth Endpoint' which just contains a link to the sourceforge site.

It seems I must be stupidly missing a step somehow but I cant figure it out.. help please :)
0

#135 User is offline   begemotik 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 15-August 14

Posted 17 August 2014 - 08:16 AM

View PostPicto, on 22 June 2014 - 05:36 AM, said:

Hi everyone,

This should be an easy answer for some of you as a few seem to have this working ok (hopefully!)

I have been trying for a while to get this going with facebook, I've set up the facebook app and as far as I can see i've followed the latest set of installation instructions completeley. But when I come to log in with facebook (via mysite.com/hybridauth) I just get taken to a mostly blank page titled 'Hybridauth Endpoint' which just contains a link to the sourceforge site.

It seems I must be stupidly missing a step somehow but I cant figure it out.. help please :)

You will need to incorporate a widget into your login view that will take you through the OAuth flow. The widget is documented in the installation guide. You can't just do it directly :)

I've written a complete guide on installing both Yii-user and hoauth: http://www.ponomaryo...-a-yii-project/
Hope someone finds it helpful!
0

#136 User is offline   Ulug`bek 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 16-December 14

Posted 22 December 2014 - 07:22 AM

can somebody tell me about that error: "The redirect_uri URL must be absolute" , how can I solve the problem. I tried by
public function getConfig() {
	return array(
		'baseUrl' => Yii::app()->baseUrl,
		'base_url' => Yii::app()->baseUrl.'/hybridauth/default/callback', // URL for Hybrid_Auth callback
		'providers' => $this->providers,
	);
}


If I write like that:
public function getConfig() {
	return array(
		'baseUrl' => Yii::app()->baseUrl,
		'base_url' => Yii::app()->baseUrl,//.'/hybridauth/default/callback', // URL for Hybrid_Auth callback
		'providers' => $this->providers,
	);
}

I get message "Something went wrong, did you cancel?"
0

Share this topic:


  • (7 Pages)
  • +
  • « First
  • 5
  • 6
  • 7
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users