Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1001065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:36:38+00:00 2026-05-16T07:36:38+00:00

We have to have a register method available via web service that is written

  • 0

We have to have a “register” method available via web service that is written in java so hence forth we do not have access to the Drupal API. But we need to be able to register a user successfully. Simply adding a user to the users table will not do it as the newly created users are never able to login successfully. Again I love the Drupal API and would always use that as that is the “correct” way to do it but in this case we just dont have the faculty to do that. Any insights to this dilemma ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:36:39+00:00Added an answer on May 16, 2026 at 7:36 am

    You’ll want to step through the user_save() API function to get an idea of what Drupal does when creating a new user.

    There isn’t any deep magic to what Drupal does with saving that type of data: it’s all in the database. So, while it’s not ideal that you can’t use the Drupal API, you’re really only dealing with two database inserts: the {user} table insert (which you’ve already done), and the {users_roles} table insert.

    Based on your info, I suspect the missing link is that you’re not adding a row to the {users_roles} table for your new user’s UID. The relevant line in user_save():

    db_query('INSERT INTO {users_roles} (uid, rid) VALUES (%d, %d)', $account->uid, $rid);
    

    Where $account->uid is the UID of the newly created user, and $rid is the ID of the role you want to give the user. A new user needs at least the authenticated user role.

    Everything else in user_save() is mainly sanity checking (user_save() handles updating a user in addition to creating a new one) and hook firing, which you likely don’t need to worry about for this use-case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a register page that saves the data to a database the only
I have a requirement where I have to register users first via email. So,
I want to build a web application where users can register and have a
I am using Spring MVC 3.1 to develop a Java web app. I have
I am writing a WCF web service which allows to register new users in
I have register form. I want to check new username that is in db
I have configured some basic routes that are available for all users before they
I know that to interact from Javascript to Java you have to inject a
Error Unable to start activity ComponentInfo: java.lang.IllegalStateException: System services not available to Activities before
I have a Controller called Register that looks like this: class Register extends CI_Controller

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.