executable_mjru-auth 502 B

12345678910111213
  1. #!/bin/sh
  2. IHS_USER="${IHS_USER:-pyhalov}"
  3. IHS_PASS="${IHS_PASSWORD:-$(pass show majordomo/private/hms/pyhalov)}"
  4. IHS_ENDPOINT="${IHC_ENDPOINT:-https://api.majordomo.ru}"
  5. curl --silent \
  6. --request POST "${IHS_ENDPOINT}/oauth/token" \
  7. --header 'content-type: application/x-www-form-urlencoded' \
  8. --header 'x-requested-with: XMLHttpRequest' \
  9. -d "grant_type=password&username=$IHS_USER&password=$IHS_PASS&client_id=service&client_secret=service_secret" \
  10. | jq -r '.access_token'