Yii hybridauth fails including "User.php" - php

I'm trying to set up hybridAuth module for Yii. I did everything exactly as told in http://www.yiiframework.com/extension/hybridauth/ . Also did set up googles key ans secret. Trying to sign-in with Google the DefaultController tries to create a new User object but fails in Yiibase.php trying to include User.php (427). I'm using latest 1.1.14 Yii framework. The yii project is brand new and stock (I mean I haven't screwed up any standard components).
Thanks and let me know if I can get you guys any further information.

It doesn't needs the user extension. It's trying to access the User model, wich probably does not exists. Create a user table and the correspondig model to get it working.
As an alternative you can follow this wiki and do the integration yourself.

the extension is trying to use user extension(I didn't mean use, I meant reached for a user model),
try adding user extension to keep records of authenticated users.
UPDATE:
on file hybridauth\controllers on line 64 we have $user = new User;
here is what causing the issue, you can use user extensions or use your own user functions.

Also I'd like to add that I's recommended by HybridAuth project to use Yii extension HoAuth.
http://www.yiiframework.com/extension/hoauth/

Related

Laravel 5.6 custom registration using auth class

Hey guys i am new to laravel and i am trying to make a login system for lecturerand admin where the admin can register and edit the users details. I am aware that Laravel has an in-built auth system but it does not have the the function to edit the user details. There are two options that i thought that might work
Use the existing auth system for register/login while adding a new controller and view to edit the users details.
create a new register/login system from scratch with a new migration table and implement the edit functions. But my concern is if i create from scratch how to i use the Auth() class to handle the access control?
Anyone able to clarify for me which option works??
i suggest you to use laravel Auth Class and then use some ACL package like laravel-permission
https://github.com/spatie/laravel-permission
to handle you user as admin,guest and so more
you can create multi level users with different permissions and roles
Definitely option one
It's always good to use Laravels built-in user scaffolding
Most of the authentication and authorization for your application will already be handled
Why reinvent the wheel? Option 1 it is.

eZPublish 5 - Custom user authentication (multifactor)

We have eZPublish 5. The authentication is handled by User kernel module kernel/user/login.php. This PHP script is called when trying to access a siteaccess which requires authentication.
Example scenario:
When trying to access http://example.com/marketing
it redirects me (when not logged in) to http://example.com/marketing/user/login
Which is expected behaviour.
What I would like to achieve is to rewrite the kernel/user/login.php file and preferably keep the url the same (this is not mandatory).
I need to do this because I need to integrate Duo Security Multifactor Authentication, so I need to handle the logging in in a custom way.
So on the first page I need to display the login form, then when it is submitted I need to verify if credentials are correct (but not log in the user at this phase) then I need to return another view where an iframe is present for the second authentication, and when the second authentication is successful only after that I can login the user and redirect him/her to the desired page.
Is there any way how to do this? I tried to create an extension with a module user and view login.php but it doesn't worked - the User kernel login.php is executed always when http://example.com/marketing/user/login is hit.
I am trying to do this for several days now but no luck and I'm out of ideas.
Thanks in advance for any help.
Welcome to the eZ Community!
What you want / need is both possible and quite simple to implement :)
First based on your description I recommend the following:
https://github.com/brookinsconsulting/bckernelmoduleoverride
Note: We forgot to package and release this extension some time ago but have been using it as part of our open source ezpedia.org code base. We thank you for reminding us and prompting us to package the code for individual usage.
Concerning double authentication we did something similar but actually quite different with this solution:
https://github.com/brookinsconsulting/bcconfirmpassword
Now code sharing aside. You may want to first study the login handler system which provides for many forms of custom user authentication system. https://en.ezpedia.org/en/ez/login_handler
Yet from your description and some intuition on our part it truly sounds like without more information that you very well do need to both override the default user/login module view (what we call a kernel module view copy override; copy the default module and customize the code within an extension module). We have done this -a lot- for special customer use cases and it's not very hard.
Most of the time the hard part is getting all the module and module view identifiers to not conflict once within an module extension and we think that will be less of a problem for you if you simply use / leverage the bckernelmoduleoverride extension which provides for using default kernel modules and module views customized within a module view extension.
Please feel free to ask further questions or share more information about your custom authentication system your trying to integrate. Frames in this day and age sounds like a painful system to be required to implement for a secondary authentication system.
We hope this helps!
Note: This thread is cross posted from: http://share.ez.no/forums/ez-publish-5-platform/ezpublish-5-custom-user-authentication-multifactor

How to implement SabreDav/CalDav in CakePHP 3.0?

I'm trying to implement CalDav in CakePHP 3.0 and I'm new to both of them. I've created a Customer portal and want that every single user has access to his appointments.
I followed the tutorial http://sabre.io/dav/caldav/, but when I try to run mypage/calendarserver.php/ (which i've located in webroot), it only appears my own created login page (it should display a login from sabredav).
The real problem is: when I try to create for example: "mypage/calendarserver.php/principals" Cake tells me that the principals controller is missing. I don't want to use any controller of Cake when I access this url. Does somebody know how to avoid calling the controller of Cake?
Thanks for your help.

User Roles and Permission in CodeIgniter 2.1.4

I am using this version of codeigniter 2.1.4 and I want to add user roles and permission. I am totally new for this framework I have done this in Zend but I am not able to find any library in codeigniter. I am also confused with Hooks.
Anybody will explain me what the purpose of hooks in a layman language. and also about the library with a small example with the same version so that it will be easy to understand.
Thanks.
Since you already have experience with the Zend ACL, why not use it in your CodeIgniter project? (Link)
Just set up your roles, resources, and permissions in your "MY_Controller.php" file so they're available to all your controllers. Also set up your user in MY_Controller (e.g. $this->theUser) for the same reason.
Set up classes for your resources in your Libraries folder that "implements Zend_Acl_Resource_Interface" and a "User" class for your user that "implements Zend_Acl_Role_Interface".
After setting up the ACL in MY_Controller, retrieve role(s) for the user from your database and add them to your user:
$roles = $this->theUser->getRoles(); // get the assigned role(s) for the user (array)
$acl->addRole($this->theUser, $roles); // then apply them to the user
With that done, I typically put something like the following at the top of each controller:
if ( !$this->acl->isAllowed($this->theUser, 'article', 'modify') ) {
redirect( '/home', 'refresh' ); // go back home
exit;
}
Don't forget, you can even set up dynamic assertions (i.e. implements Zend_Acl_Assert_Interface) if a permission to a resource requires some logic. I typically put assertion classes immediately following their related resource class.
Use Ion_Auth, it is an authentication library with a system of user roles. Should be easier for you to create permissions in your code.
This is only my 2-cents but Hooks are somehow similar to an event-driven approach. This means that they will be triggered at particular times in your code.
In the documentation, you can see that CI has 7 hooks ready. Thus, you can inject any script of yours at those 7 moments.
Let's say that you can add a script during the hook pre_controller that checks for the user's browser's language, so that in all your controllers you already know the language to use.
Note that ion_auth also supports hooks.

user authorization in custom component

hi I am developing custom component in joomla 1.7 I want to restrict user task based on user groups. I have created table and saved all the controller names and tasks and saved the permissions for the previous tasks with user group id. In central com_component.php file I check the user permissions and authorized the taks with controller. This is working really well. What I want to know is can I use addACL() or authorized() functions to do this which is I really don't understand correctly. Bcoz Here I want use both controller and task together.
Developing a component with the Access Control List is described on Joomla! documentations in detail (link). I think the first thing to do is follow the instructions described there. There is even sample code that you can download and use.
The plugin 'GroupJive' for the Community Builder component has ways to do what you are looking for. I would look to that project at least for a guideline. I will be digging into a similar challenge this weekend and if I find code without the need for the component I will let you know.

Categories