Skip to content

Clear user accounts endpoint not working as intended #3013

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

Closed
hamboomger opened this issue Jan 9, 2021 · 5 comments · Fixed by #3044
Closed

Clear user accounts endpoint not working as intended #3013

hamboomger opened this issue Jan 9, 2021 · 5 comments · Fixed by #3044

Comments

@hamboomger
Copy link

[REQUIRED] Environment info

firebase-tools:
9.1.2

Platform:
MacOS 11.0.1

[REQUIRED] Test case

Request to:

DELETE http://localhost:9099/emulator/v1/projects/{projectId}/accounts

[REQUIRED] Steps to reproduce

  1. Run firebase auth emulator using FIREBASE_AUTH_EMULATOR_HOST=localhost:9099
  2. Make a DELETE request to http://localhost:9099/emulator/v1/projects/{projectId}/accounts as described in the API
  3. Get an authentication error

[REQUIRED] Expected behavior

Delete all user accounts

[REQUIRED] Actual behavior

Following response:

{
    "error": {
        "code": 401,
        "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
        "errors": [
            {
                "message": "Login Required.",
                "domain": "global",
                "reason": "required",
                "location": "Authorization",
                "locationType": "header"
            }
        ],
        "status": "UNAUTHENTICATED"
    }
}
@hamboomger
Copy link
Author

If it's not a bug and is an intended behaviour, could you please add more information about the authentication credential to the authentication api reference page?

@samtstern
Copy link
Contributor

@hamboomger can you try adding the Authorization header to your request with the value Bearer owner? I'll also make sure we get the docs up to date.

@samtstern
Copy link
Contributor

@yuchenshi is this a bug or a docs issue?

@hamboomger
Copy link
Author

@samtstern yep, works with the Authorization header, thanks 👍

@yuchenshi
Copy link
Member

I'd say we should drop the requirement for the Authentication header since it is confusing. It's an emulator-specific API anyway, plus clearing data in Firestore emulator doesn't require Authentication header either.

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

Successfully merging a pull request may close this issue.

3 participants