hoermi

access_token

Aug 1st, 2022 (edited)
736
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. import requests, json
  4.  
  5. token_endpoint = "https://gluu.my.domain/oxauth/restv1/token"
  6. payload = {"grant_type":"client_credentials", "scope":"myScope"}
  7. client_id = '72***02'
  8. client_secret = "A***p"
  9. try:
  10. response = requests.post(token_endpoint, data=payload, verify=True, auth=(client_id, client_secret))
  11. except AttributeError:
  12. print ("no such attribute")
  13. except NameError:
  14. print ("no such name")
  15.  
  16. print response.text
  17.  
Advertisement
Add Comment
Please, Sign In to add comment