Get private user token with python Gitlab API

I am trying to get the private keys of a user token and SSH using the gitlab API (v4) using the private admin token in my curl requests.

I can get the user SSH key by running the following command:

curl --header "PRIVATE-TOKEN: my_admin_token" "https://gitlab.my_gitlab.com/api/v4/users/user_id/keys"

But I can not find a similar way to get its private token (I need it for further applications in the python script). How can i do this?

+4
source share
2 answers

This seems to be impossible. When you create a token, you need to save it, since you cannot access it later (see the attached screenshot):

enter image description here

+2
source
0

Source: https://habr.com/ru/post/1689071/


All Articles