Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Darkscribes Community

  1. Home
  2. Uncategorized
  3. Do I need to use the admin bearer token for normal user actions via API? (e.g. login, post, upvote)

Do I need to use the admin bearer token for normal user actions via API? (e.g. login, post, upvote)

Scheduled Pinned Locked Moved Uncategorized
2 Posts 2 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A This user is from outside of this forum
    A This user is from outside of this forum
    [email protected]
    wrote last edited by
    #1

    Hi,

    I'm working on an Android app that uses NodeBB as the backend. I'm trying to interact with everything through the NodeBB API — like registering a normal user, logging them in, creating topics, replying, upvoting, etc.

    My main question is:

    Do I need to use the admin bearer token for all these actions, or should each normal user get their own token after login and use that?

    Also, I'm a bit confused about the login endpoint. I've seen both:

    /api/login

    /utilities/login

    Which one is the correct endpoint to log in a normal user using the API?

    Apologies if this is a basic question — I checked the docs but couldn't find a clear answer or a complete example for handling the full user flow via API. Any help or guidance would be much appreciated!

    Thanks in advance!

    julian@community.nodebb.orgJ 1 Reply Last reply
    0
    • A [email protected]

      Hi,

      I'm working on an Android app that uses NodeBB as the backend. I'm trying to interact with everything through the NodeBB API — like registering a normal user, logging them in, creating topics, replying, upvoting, etc.

      My main question is:

      Do I need to use the admin bearer token for all these actions, or should each normal user get their own token after login and use that?

      Also, I'm a bit confused about the login endpoint. I've seen both:

      /api/login

      /utilities/login

      Which one is the correct endpoint to log in a normal user using the API?

      Apologies if this is a basic question — I checked the docs but couldn't find a clear answer or a complete example for handling the full user flow via API. Any help or guidance would be much appreciated!

      Thanks in advance!

      julian@community.nodebb.orgJ This user is from outside of this forum
      julian@community.nodebb.orgJ This user is from outside of this forum
      [email protected]
      wrote last edited by
      #2

      ajay_89 the admin bearer simply allows you to call the NodeBB API as any uid. A user token is keyed to a specific ID.

      In the Android app you would probably want to use a user token based on the logged in user. That is because it is likely unsafe to store the admin token in the APK. It can be decompiled and leaked.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      Powered by NodeBB Contributors
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups