I am trying to retrieve user access token for openshift login. The way I want to achieve is through curl command where user provides his username and password and in response will get the token. I cannot use openshift python client and it has to be a GET/POST call only.
You need to do the below steps
export TOKEN=$(curl -u user1:test@123 -kI 'https://myose01:8443/oauth/authorize?clientid=openshift-challenging-client&response_type=token' | grep -oP "access_token=\K[^&]*")
export ENDPOINT=myose01:8443
Test sample:-
curl -k \
-H "Authorization: Bearer $TOKEN" \
-H 'Accept: application/json' \
https://$ENDPOINT/oapi/v1/projects