oneeach
$fetch with cert & key
I have a non-person entity cert and key and would like to provide those during a $fetch to get a one-off token from an auth-provider. How can I do that?
This works for me using a curl command (below) but can't figure out how to do this using $fetch
TOKEN=$(curl -L -X POST 'https://ssl-url/realms/realm/protocol/openid-connect/token' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--cert /path/to/certificate.crt \
--key /path/to/key.key \
--data-urlencode 'grant_type=password' \
--data-urlencode 'client_id=scs-npe-authentication' \
--data-urlencode 'scope=openid' | jq '.access_token')
3 replies