Laravel impersonate user without using a package - laravel

I would like to know how to impersonate user without using a package in Laravel/Vue application. I'm using Passport for authentification.
From my understanding and how I think it might work is that I test if the master password is entered and then the admin user is automatically redirected to the user account which is taken from the email which is also entered but I cannot understand how exactly this should be done. Any help would be appreciated. Thanks!

Related

How to authenticate users with an integer such as account number as the username

I have a problem authenticating users in my banking application. I want super users to be created and authenticated using email. However, I want that normal users be registered and assigned account numbers. The normal users would then use the account numbers to login. How do you achieve authentication of these different kinds of users with different username fields in one django project.
I have tried overriding the USERNAME_FIELD to account numbers so that normal users would use that to login. It doesnt help to login normal users. For superusers, it prompts for account number when I run
python manage.py createsuperuser
Kindly assist in understanding how to handle this kind of custom authentication.
Django is ready to support your requirement. AUTHENTICATION_BACKENDS support multiple backend as list. For normal user you have to write custom backend and Add that in AUTHENTICATION_BACKENDS.
This link will help you.

How to allow AD users the ability to change password if expired?

If you have an application that is being authenticated with Active Directory using Forms Authentication in MVC, how can you allow the user to change his password after it expires?
From what I am observing, if a user's password has expired, Membership provider will simply refuse to let you authenticate, thus not allowing the user to access the page. However, if I modify the page, to allow the user to go to it, and enter a user name, old password, and new password, it still seems to not work, just returning 'false' from the change password function.
Any insight or solutions on this?
Any insight or solutions on this?
Insight refering to scripts. if yes so please have a look at these links
http://blogs.technet.com/b/heyscriptingguy/archive/2010/08/17/how-to-change-a-user-s-active-directory-password-with-powershell.aspx
http://community.spiceworks.com/scripts/show/1889-reset-ad-user-password
Moreover there are many self rest solution. Please update so that a name would be explained to you
Thanks.

Google Admin SDK [Directory - API] check User password

I am using Google Admin SDK Directory API to create users and using Service account I am able to perform CRUD operations on them.
I have a requirement whereby I have to check the credentials of users created using SDK.
When you fetch the users the password is not returned, hence comparison cannot be done.
I'll really appreciate if someone lets me know what would be effective way of approaching the checkCredentials function.
Thanks.
Google does not ever return the value of the password. That would be a monumental security risk.
See their documentation in regards to the user resource used in the directory API. It specifically states that the password field is never returned. It can only be used for setting the password.
If your requirement is too check creds on a newly created user, you should look into trying to login as the user with the password you just sent, using the google auth Apis
At the moment, the only solution I've found is to simulate the user login flow with a fake browser (Apache's httpcomponents-client for Java for example) pointing to Google Account ServiceLogin.

Using system password to serve as a password for an application

I am trying to use the users system password to serve as the password for an application I am creating. I have researched uac functions but none of that is really helping me. Any ideas on where i should look next?
Use the System.DirectoryServices namespace contained in System.DirectoryServices.dll to authenticate the user using Active Directory.
You can't recall the password of the currently logged in user. What you do is trust the identity of the person, since they've already been authenticated.

Authenticating a GWT application in Joomla

I have a GWT application that I would like to integrate with the Joomla login system. Everytime an AJAX request is sent to the server, the application should check that the user is authenticated (username and password pass)
Any ideas of how to implement this?
I had these ideas but don't like them for the reasons mentioned:
Ask the user for there username and password (again...) and then save it in a cookie. (Security is an issue and I have to ask them for the username and password after they have already logged into the main joomla system.
Save the username and password in a PHP session variable. (This might work but what would happen if the sesson timed out, the user may take some time configuring the GWT data structures, so it would not be nice for an error like this to occur).
Does anyone have better ideas?
Will users be authenticating against the GWT application? If so, you might want to create an Authentication plugin for Joomla that backfills users from GWT into Joomla.

Resources