multistep registration from in drupal 7 need to add a user and role
// Register this new user.
    $roles = user_roles();
    $userinfo = array(
      'name' =&gt; $name,
      'pass' =&gt; user_password(),
      'init' =&gt; $name,
      'status' =&gt; 1,
      'access' =&gt; REQUEST_TIME,
      // This is where we are different from the default function.
      'roles'        =&gt; array(array_search('campus_student', $roles) =&gt; 1),
      // the field_* values come from custom columns added through
      // thhe admin ui under manage fields for users.
      'field_first_name'   =&gt; array(LANGUAGE_NONE =&gt; array( 0 =&gt; array('value' =&gt; $get_ldap_details['first_name']))),
      'field_last_name'    =&gt; array(LANGUAGE_NONE =&gt; array( 0 =&gt; array('value' =&gt; $get_ldap_details['last_name']))),
      'field_perm_number'  =&gt; array(LANGUAGE_NONE =&gt; array( 0 =&gt; array('value' =&gt; $get_ldap_details['campus_perm_number']))),
      'mail' =&gt; $get_ldap_details['mail'],
    );
    $account = user_save(drupal_anonymous_user(), $userinfo);


EDIT: You can see how drupal itself typically creates in a user via drupal_external_login_register(). The above example uses some API calls to get all Roles and assigns very clearly X additional roles, it also sets up additional drupal Fields tied to the user entity.