Top

Unable to create user with C# administration object

Commentaires

5 commentaires

  • Christophe IRLES

    Hi,

    In your example, you have created a user without specifying its companyId. (the argument after lastName)
    It's better to specify it. Without it, it really depends of the right of the user you use.

    If you still have a pb, please provide me the exact error you have.

    Note: I suggest you to use something like that to log error:

    Util.SerializeSdkError(callback.Result)

    Regards,
    Christophe

     

    0
    Actions pour les commentaires Permalien
  • William Godfrey

    Hi Christope,

    I modified the code to now include a nickname and the company id as seen below:

    admin.CreateUser(userEmailAddress, userPassword, firstName, lastName, firstName, company_id, true, createAdmin, callback

    The error I received was:

    ErrorCode:[401] - ErrorMsg:[Unauthorized] - ErrorDetails:[Format is Authorization: Bearer [token]] - ErrorDetailsCode:[401201]
    0
    Actions pour les commentaires Permalien
  • William Godfrey

    Never Mind I managed to fix it by placing the following code between the login and the admin call.

    while (_rainbowApp.ConnectionState() != Rainbow.Model.ConnectionState.Connected || !_rainbowApp.IsInitialized())
    {
    if (_rainbowApp.ConnectionState() == Rainbow.Model.ConnectionState.Disconnected)
    {
    break;
    }
    }
    0
    Actions pour les commentaires Permalien
  • Christophe IRLES

    Hi William,

    Take into account that all API using a callback are asynchronous. So you need to have an answer (i.e. checking result of "callback.Result.Success") before to continue.

    Login process is even more complex because the callback of this API provide you the information of correct or incorrect login/pwd. If they are correct you need also to wait event "InitializationPerformed" because it's necessary to gather several information for server before to be fully operational.

    Regards,
    Christophe

     

    0
    Actions pour les commentaires Permalien
  • Christophe IRLES

    Also notice that question about SDK usage should be done in the "Hub Support Community".

    0
    Actions pour les commentaires Permalien

Vous devez vous connecter pour laisser un commentaire.

Vous n'avez pas trouvé ce que vous cherchez?

  • Contactez-nous

    Vous avez des questions? Laissez-nous un message pour obtenir plus d'informations.

    Contactez-nous
  • Demandez à la Communauté

    Vous avez besoin d'aide? Posez vos questions à la Communauté et obtenez des réponses d'autres utilisateurs Rainbow.

    Poster un message