Skip to content

Can not create first user (admin) with API #5376

Closed
@toni-moreno

Description

@toni-moreno
  • Gitea version (or commit ref): 3973572
  • Git version: 2.17
  • Operating system: debian
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • [X ] SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I'm working in a automated gitea provisioning script , and the admin user and password is provided as parameter to this script.

I've tested with as auth token the security.SECRET_KEY and security.INTERNAL_TOKEN configured in my app.ini but It doesn't work. ( as you can see below)

Which token should I use to create the first gitea user (the admin user) ?

ipasdev@ipasdev01:~/ipas-docker/gitea/gitea$ curl -i -X POST "http://git.mydomain2.org/api/v1/admin/users?access_token=P9R8gvGsZRKw4GjFQjnyUFmY00WJQA3bxzLf1BJg6hvEuzbQwc2aACBB4qwiWVS5" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"email\": \"[email protected]\", \"full_name\": \"string\", \"login_name\": \"string\", \"password\": \"string\", \"send_notify\": true, \"source_id\": 0, \"username\": \"string\"}"
HTTP/1.1 403 Forbidden
Server: nginx/1.13.12
Date: Wed, 21 Nov 2018 22:55:45 GMT
Content-Length: 0
Connection: keep-alive
Set-Cookie: lang=en-US; Path=/; Max-Age=2147483647
Set-Cookie: i_like_gitea=7050120b02bef2a4; Path=/; HttpOnly
Set-Cookie: _csrf=JgjWWByY6Bsw9w_QXcom3JhsRNQ6MTU0Mjg0MDk0NTg1MjI0MTE5MA%3D%3D; Path=/; Expires=Thu, 22 Nov 2018 22:55:45 GMT; HttpOnly
X-Frame-Options: SAMEORIGIN

Metadata

Metadata

Assignees

No one assigned

    Labels

    reviewed/wontfixThe problem described in this issue/fixed in this pull request is not a problem we will fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions