Is it possible to use my application user name and id instead of creating new account in nodebb with random uid?


  • @julian I am trying to use my own application user details (username and userID)

    Example:

    {
       username: 'venkat',
       userId : "2a5t8862-88k52-48569df5"
    }
    

    can I use above user details for nodebb.

    As of now nodebb is creating incremental id (uid)
    instead of that uid, can i use my own userId as nodebb
    uid

    Present Nodebb user details:

    {
       username: "venkat",
       uid: 5
    }
    

    my requirement is

    {
      username: 'venkat',
      uid: '2a5t8862-88k52-48569df5'
    }
    

    is there any way to implement the above requirement ?

    CC: @vinu

  • Global Moderator

    @venkat you want to store a map in the database, mapping NodeBB uids to your userId format.


  • Same situation here.
    We have all our internal services (Marketing, Accounts, Shells, Mail, Forum etc) where users use same useraccount for loging-in.

    Every service works except forum. Ive done as @PitaJ suggested above but no luck.

    Anyone ?

  • Global Moderator

    What did you try? Have you seen the session sharing plugin?


  • @pitaj Is it possible to add nodebb uid as a string

    I did some code change in Nodebb repo for adding string as a uid, it is storing but while accessing I am not getting the proper data.

    can you suggest me the better solution?

    I need to use my identifier(string) as a nodebb uid instead of auto increment uid(number) ?

  • Global Moderator

    @venkat have you looked at the session sharing plugin?

    https://github.com/julianlam/nodebb-plugin-session-sharing

    It provide functions for retrieving the NodeBB id from your id.

    Using that plugin is the recommended way of sharing sessions between applications.

    Changing the NodeBB id format is a futile effort. You can't just change it to a string. The closest you can do is map your id to the NodeBB id.

Suggested Topics

  • 1
  • 9
  • 23
  • 3
  • 3
| |