Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot 'activate' a new created user through exposed API #1376

Open
istamoulis opened this issue Apr 20, 2021 · 2 comments
Open

Cannot 'activate' a new created user through exposed API #1376

istamoulis opened this issue Apr 20, 2021 · 2 comments

Comments

@istamoulis
Copy link

istamoulis commented Apr 20, 2021

We are trying to use exposed API in order to perform some actions in our reportportal instance.

We are trying to create a new user and then use this new user in order to perform other actions (like creating widjets, dashboards, etc.).

STEPS:

  1. We Create a new user via {url}/api/v1/user.
  2. Then we Create UI_token {url}/uat/sso/oauth/token. We take the access_token in order to use it for the Get API token call.
  3. We are trying to get the api token through {url}/uat/sso/me/apitoken.

The problem is that we take error:
Code 404 - Not Found
Body:
{ "errorCode": 4046, "message": "User 'test' not found."}

As far as we can see, the calls are correct, but it seems that a step is required between steps 2 and 3.
To be more precise, if after step-2 we login manually to reportportal, then the step-3 will pass.
So, it seems that user is created but not "activated"...

Using reportportal UI
As we can see in the UI, the first time we login we can see 2 different apitoken calls. The first one fails with 404, and the second one passes. This is visible in "Network" tab but also in the errors in the "Console", as it is illustrated bellow:

login-manually-1

login-manually-2

ReportPortal version:

docker-images-versions

@istamoulis istamoulis changed the title Cannot "activate a new created user through exposed API Cannot 'activate' a new created user through exposed API Apr 20, 2021
@joelpramos
Copy link

@istamoulis Faced the same problem. If you notice in the network tab the second apitoken call is a POST request instead of a GET. Just make it POST straight up the first time and it'll work. After that GET also works.

been a year so you probably figured that out yourself!

@istamoulis
Copy link
Author

istamoulis commented Jan 18, 2022

@joelpramos thanks for sharing. It has been almost a year, but since we did not use the script so much, we had not found a solution. I just tried the POST before the first GET and indeed it works! Thank you for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@istamoulis @joelpramos and others