# Log a user in, without their password.

**URL:** <https://forum.phpvms.net/t/log-a-user-in-without-their-password/10383>\
**Category:** Development Help\
**Created:** [July 24, 2015, 4:08pm UTC](https://forum.phpvms.net/t/log-a-user-in-without-their-password/10383 "2015-07-24T16:08:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mindfulhacker](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/m/d78d45/32.png) [@mindfulhacker](https://forum.phpvms.net/u/mindfulhacker)\
**Post date:** [July 24, 2015, 4:08pm UTC](https://forum.phpvms.net/t/log-a-user-in-without-their-password/10383/1 "2015-07-24T16:08:22Z")

</div>

I’m currently creating a script that works with my other systems on the server. I have got a page, which when a user logs in successfully, returns the CID, First Name and Last Name from database.

I’d like to make it, so when my page renders, it logs the user into phpVMS.

Except, I won’t have a password, just CID and name.

I can get the userID from the database, using MySQL, but apart from that, I can’t see any logical way of doing this.

Any ideas?

---

<div class="post-metadata">

**Author:** ![magicflyer](https://forum.phpvms.net/user_avatar/forum.phpvms.net/magicflyer/32/210_2.png) [@magicflyer](https://forum.phpvms.net/u/magicflyer)\
**Post date:** [July 25, 2015, 12:12am UTC](https://forum.phpvms.net/t/log-a-user-in-without-their-password/10383/2 "2015-07-25T00:12:37Z")

</div>

> I’m currently creating a script that works with my other systems on the server. I have got a page, which when a user logs in successfully, returns the CID, First Name and Last Name from database.
> 
> I’d like to make it, so when my page renders, it logs the user into phpVMS.
> 
> Except, I won’t have a password, just CID and name.
> 
> I can get the userID from the database, using MySQL, but apart from that, I can’t see any logical way of doing this.
> 
> Any ideas?

That’s very very unsecure. Anyone could get everyone’s email address, sensitive profile information, change passwords(Think about logging in to smartCARS), and a few other things I can’t think of. VERY VERY unsecure, and a breach of a user’s privacy policy.

I apologize if I am misunderstanding your intent.

---

<div class="post-metadata">

**Author:** ![mindfulhacker](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/m/d78d45/32.png) [@mindfulhacker](https://forum.phpvms.net/u/mindfulhacker)\
**Post date:** [July 25, 2015, 8:13am UTC](https://forum.phpvms.net/t/log-a-user-in-without-their-password/10383/3 "2015-07-25T08:13:31Z")

</div>

> That’s very very unsecure. Anyone could get everyone’s email address, sensitive profile information, change passwords(Think about logging in to smartCARS), and a few other things I can’t think of. VERY VERY unsecure, and a breach of a user’s privacy policy.
> 
> I apologize if I am misunderstanding your intent.

Basically, rather than using phpVMS’s login system, I want to use my own, which is implemented with all the other things I run (VA Forums etc).

In the login template, I redirect the user to my own system, and the user then logs in there. If the credentials are correct, the login system (should) log the user into phpVMS.

But, the system only returns the CID, PilotID and name, therefore I have no password to check with phpVMS’s login system.

So, I was wondering if there was a way using sessions etc / rewriting the login function, so the password would not be needed,

Since the function would be called by the login system, only once the user has authenticated themselves, I can’t see why this wouldn’t be secure.

---

<div class="post-metadata">

**Author:** ![mindfulhacker](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/m/d78d45/32.png) [@mindfulhacker](https://forum.phpvms.net/u/mindfulhacker)\
**Post date:** [August 9, 2015, 5:47pm UTC](https://forum.phpvms.net/t/log-a-user-in-without-their-password/10383/4 "2015-08-09T17:47:42Z")

</div>

Sorry for the **\*bump** \*\* \*\*\*…
