Eugene Victoroff
Eugene Victoroff

Reputation: 21

How can I fix "unauthorized" error when accessing Report Portal API?

How I can get access to API?

I'm getting

{
  "error": "unauthorized",
  "error_description": "Full authentication is required to access this resource"
} 

when trying to use basic authentication type.

Upvotes: 2

Views: 2771

Answers (1)

avarabyeu
avarabyeu

Reputation: 736

ReportPortal uses Oauth to authenticate clients. So, your header should look like:

"Authorization" : "Bearer YOUR_TOKEN"

ReportPortal provides two types of tokens: expiring and non-expiring. Expiring tokens are created for UI so that it can handle user sessions. Non-expiring tokens are introduced for API clients. Actually, non-expiring token can be found (and revoked) from user profile page: ReportPortal token

Upvotes: 6

Related Questions