# Pre Authentication Process

**URL:** <https://community.dreamfactory.com/t/pre-authentication-process/1172>\
**Category:** Authentication & Security\
**Created:** [June 9, 2015, 2:39pm UTC](https://community.dreamfactory.com/t/pre-authentication-process/1172 "2015-06-09T14:39:31Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![navjinder](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/navjinder/32/313_2.png) [@navjinder](https://community.dreamfactory.com/u/navjinder)\
**Post date:** [June 9, 2015, 2:39pm UTC](https://community.dreamfactory.com/t/pre-authentication-process/1172/1 "2015-06-09T14:39:31Z")

</div>

Hi There

Right now I am using DSP with an Angularjs app and everything is working fine as the users are checked against the DSP user table but I would like to do the following:

1. User enters the email and password
2. Instead of checking against the DSP user database it should send an http request to a password protected URL which takes in the email and password and returns code 200 if it is good.
3. Then update the password in the DSP account and login in the user using the regular DSP user database credentials.

This is the equivalent code using PHP CURL:

```
$curl = curl_init('https://mail.google.com/mail/feed/atom');
                curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
                curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $this->params->get('verifypeer', 1));
                curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
                curl_setopt($curl, CURLOPT_USERPWD, $credentials['username'] . ':' . $credentials['password']);
                curl_exec($curl);
                $code = curl_getinfo($curl, CURLINFO_HTTP_CODE);

                switch ($code)
                {
                    case 200:
                        $message = 'ACCESS_GRANTED';
                        $success = 1;
                        break;

                    case 401:
                        $message = 'ACCESS_DENIED';
                        break;     
                                   
                    default:       
                        $message = 'UNKNOWN_ACCESS_DENIED';
                        break;
                }

```

I would really appreciate any help. I am thinking I have to edit the DSP angular-user-module to get the desired results.

---

_[View the full topic](https://community.dreamfactory.com/t/pre-authentication-process/1172)._
