Top

Unable to create user with C# administration object

Comentarios

5 comentarios

  • 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
    Acciones de comentarios Permalink
  • 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
    Acciones de comentarios Permalink
  • 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
    Acciones de comentarios Permalink
  • 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
    Acciones de comentarios Permalink
  • Christophe IRLES

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

    0
    Acciones de comentarios Permalink

Iniciar sesión para dejar un comentario.

  • Pregunte a la Comunidad

    ¿Necesitas ayuda? Haz tus preguntas en la Comunidad para obtener respuestas de otros usuarios de Rainbow.

    Enviar un mensaje.