question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing authorization Bearer token

See original GitHub issue

@satterly Issue Summary Accessing to API userinfo get "message": "Missing authorization Bearer token"

Environment

  • OS: Vagrant alerta-centos7

  • API version: Alerta API 7.4.4

  • Deployment: Vagrant (Modified to use Postgres 11)

  • For self-hosted, WSGI environment: apache/mod_wsgi

  • Database: Postgres

  • Server config: Auth enabled? No Auth provider? Basic Customer views? No

  • web UI version: 7.4.4

  • CLI version: alerta client 7.4.0

To Reproduce Steps to reproduce the behavior:

  1. Use API (by browser or Postman)
  2. Config Header with Key demo-key
  3. Get
{
  "code": 401,
  "errors": null,
  "message": "Missing authorization Bearer token",
  "requestId": null,
  "status": "error"
}

Context / Final objective I’m creating a plugin for Messagebird.

  1. I intend that a new critical alert arrive and a call is made. To get the number I want search if the users are in a group and get the number from the comment field.

  2. When a existing alert change severity (not status) from critical to warning or critical to ok, a sms is send to a specific number with the same logic above.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
EnzoAkiracommented, Feb 28, 2020

Thank you again.

With /user/:userid/groups - Worked

{
  "groups": [
    {
      "count": 2,
      "href": "http://localhost/api/group/47e844d7-22c1-44ac-99ee-3ebadc5f3328",
      "id": "47e844d7-22c1-44ac-99ee-3ebadc5f3328",
      "name": "FireMaster",
      "text": ""
    }
  ],
  "status": "ok",
  "total": 1
}

With /user/:userid - the json message doesn’t show any field with groups

{
  "status": "ok",
  "total": 1,
  "user": {
    "attributes": {
      "prefs": {
        "dates": {
          "longDate": "ddd D MMM HH:mm",
          "mediumDate": "YYYY-MM-DD HH:mm:ss.SSS Z",
          "shortTime": "HH:mm:ss"
        },
        "displayDensity": "compact",
        "isDark": true,
        "isMute": true,
        "languagePref": "en",
        "refreshInterval": 2000,
        "rowsPerPage": 50,
        "timezone": "utc"
      }
    },
    "createTime": "2020-02-11T17:57:03.494Z",
    "domain": "XXXX.pt",
    "email": "bcruz@XXXXX.pt",
    "email_verified": true,
    "href": "http://localhost/api/user/4e753141-600b-4f95-bd8e-20ae378ae467",
    "id": "4e753141-600b-4f95-bd8e-20ae378ae467",
    "lastLogin": "2020-02-28T17:30:21.009Z",
    "login": "bcruz",
    "name": "Bruno Cruz",
    "roles": [
      "super admin"
    ],
    "status": "active",
    "text": "+351XXXXXXX",
    "updateTime": "2020-02-14T00:23:18.816Z"
  }
}

(some info redacted)

0reactions
satterlycommented, Feb 28, 2020

Yes users<=>groups is a many-to-many relationship so it has its own endpoint. There is also a /group/:groupid/users for the reverse relationship that lists all the users in a group.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting error 401 Unauthorised: Missing bearer authentication ...
Getting error 401: Missing bearer authentication in header, though I'm using correct api key. What do you want? fix Curl or postman?
Read more >
Bearer token is missing with application proxy - Microsoft Q&A
i have the problem that the bearer token (authorization header) is missing after the application proxy is forwarding the request to the ...
Read more >
Why is 'Bearer' required before the token in 'Authorization ...
A Bearer Token is set in the Authorization header of every Inline Action HTTP Request and Bearer itself determines the type of ...
Read more >
Bearer Authentication - Swagger
Bearer authentication (also called token authentication) is an HTTP authentication scheme that involves security tokens called bearer tokens.
Read more >
Resolve API Gateway REST API 403 “Missing Authentication ...
How do I troubleshoot API Gateway REST API endpoint 403 "Missing Authentication Token" errors? Last updated: 2022-08-26. When I try to invoke my ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found