Top

Unable to create user with C# administration object

Comentários

5 comentários

  • 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
    Ações de comentário 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
    Ações de comentário 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
    Ações de comentário 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
    Ações de comentário Permalink
  • Christophe IRLES

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

    0
    Ações de comentário Permalink

Por favor, entrar para comentar.

Ainda não consegue encontrar o que você precisa?

  • Contate-nos

    Você tem alguma pergunta sobre o Rainbow? Deixe-nos uma mensagem para obter mais informações.

    Contato
  • Pergunte à Comunidade

    Você precisa de ajuda? Faça suas perguntas na Comunidade para obter respostas de outros usuários do Rainbow.

    Enviar mensagem