Guest User

Untitled

a guest
Oct 23rd, 2017
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. let data = {
  2. grant_type : 'password',
  3. client_id : 'test-realm',
  4. username : 'admin',
  5. password : 'admin'
  6. };
  7. let headers = {
  8. 'Content-Type': 'application/x-www-form-urlencoded'
  9. };
  10. axios.post(
  11. 'https://amritmro.com:8080/auth/realms/master/protocol/openid-connect/token',
  12. qs.stringify(data),
  13. headers
  14. )
  15.  
  16. headers = {
  17. 'Content-Type': 'application/x-www-form-urlencoded',
  18. 'Authorization': `Bearer ${accessToken}`
  19. };
  20. data = {
  21. rep: {
  22. email: "test@email.com",
  23. username: "test@email.com"
  24. },
  25. path: 'test-realm'
  26. };
  27. axios.post('https://amritmro.com:8080/auth/admin/realms/test-realm/users',
  28. qs.stringify(data),
  29. headers
  30. )
Add Comment
Please, Sign In to add comment