I need to change my user registration and login pages into a secure sub domain of my site, how is it possible ? In detail,

When user logon to http://www.mysite.com/admin that must be redirected to https://admin.mysite.com and he can login from there to our main site .Is it possible ?

  • Why not just put /user and /admin under HTTPS on the main site? Commented Jun 7, 2014 at 8:38

1 Answer 1


Yes it is possible through Services module.

First you need to redirect http://www.mysite.com/admin URL to https://admin.mysite.com/ URL either through Apache redirect or through drupal redirection. Then you will capture all the information of user at this site (https://admin.mysite.com/) and consume the same at http://www.mysite.com/admin site through services module.

You can send user information in JSON or XML format, some other formats are also available there these too are more in use.

Now let's take a example:

Site: https://admin.mysite.com/ 1. Created user signup page here with some fields. Here I am taking following fields and send these fields data using JSON to respective URL (http://www.mysite.com/user-register/user/register).

    "name": "testuser",
    "pass": "12346",
    "mail": "[email protected]",
    "conf_mail": "[email protected]",
    "field_mobile_number": {
        "und": [
                "value": 12345678

2. Similarly for Sign in page, create form with two fields name and password and prepare following JSON that we would consume to this URL (http://www.mysite.com/user-register/user/login).

    "username": "admin",
    "password": "admin123"

That's done from this site. Now move on to another site.

Site: http://www.mysite.com/

  1. Enabled Services module.
  2. Create services end point.
  3. For more security you can also use Oauth module.
  4. Please go through following tutorial and follow the same steps and you would be ready to consume above services on this site.

Register User with Services (JSON) with Custom Fields


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.