How the frak do we OAUTH2 w/refresh_token out of creator?

How the frak do we OAUTH2 w/refresh_token out of creator?

I'm using EVE Online's OAUTH as a testbed (mainly because I know what all the responses will mean from my time working at CCP).

Fair note: I'm not a programmer/coder, and this was my FIRST EVER attempt at generating a script.  Took about an hour to get it to validate and save, but I DID get that far!

Here is what I've got so far:
  • Published a public creator page with a button that triggers the login and initial authorization
  • Redirects to a published creator form that catches the return values
  • authorization_code is being caught in the form (obviously, not submitting the form as its being utilized as a placeholder)
  • Haven't figured out how to call for the refresh token afterwards, or map it into a field.

My first non-copied Deluge Script



  1. // DECLARATIONS //
  2. // Combined Header //
  3. // Header Map.. just in case//
  4. // ===============================//
  5. // header = Map();
  6. // header.put("Authorization", "URL safe Base64(cd80510c71594a588677b599a2473b70:Qvu4b1aNTJ1QcjVq8IcYUY44hL7q1U5fZgDNbpC5)");
  7. // header.put("Content-Type", "application/x-www-form-urlencoded");
  8. // header.put("Host", "login.eveonline.com");
  9. //
  10. //=====Creator EVE Parameters=====//
  11. //
  12. input.redirect_uri = "https://creator.zohopublic.com/zenbros/eve-corp-manager/page-perma/EVE_OAUTH_PAGE/jVvXTPBAv3egOMrXztneGNxZCHDfDM7COebh4jSPxNRF9qZFuFrO3YvDbnCRww30tn276gba1vtQxbhJzhszTtUxjPgE0MkVZw63";
  13. state = "testing";
  14. scope = input.scope_values;
  15. grantType = "authorization_code";
  16. // EVE Headers //
  17. head = {"Authorization":"cd80510c71594a588677b599a2473b70:Qvu4b1aNTJ1QcjVq8IcYUY44hL7q1U5fZgDNbpC5)","Content-Type":"application/x-www-form-urlencoded","Host":"login.eveonline.com"};
  18. //
  19. // =============EVE URLs============= //
  20. //
  21. // Start encode AUTH URL //
  22. authMap = Map();
  23. authMap.put("authURL","https://login.eveonline.com/v2/oauth/authorize/");
  24. authMap.put("response_type","code");
  25. authMap.put("redirect_uri",input.redirect_uri);
  26. authMap.put("client_id",input.client_id);
  27. authMap.put("scope",scope);
  28. authMap.put("state",state);
  29. authStr = authMap.toString();
  30. authEnc = encodeURL(authStr);
  31. //
  32. // End Create encoded AUTH URL //
  33. //
  34. // Start encode TOKEN URL //
  35. tokenMap = Map();
  36. tokenMap.put("tokenURL","https://login.eveonline.com/v2/oauth/token");
  37. tokenMap.put("grant_type",grantType);
  38. tokenMap.put("Authorization: ",head);
  39. tokenStr = tokenMap.toString();
  40. tokenEnc = encodeURL(tokenStr);
  41. //End Encode TOKEN URL //
  42. refURL = Map();
  43. refURL.put("refLink","https://login.eveonline.com/v2/oauth/authorize?");
  44. refURL.put("response_type","code");
  45. refURL.put("code",input.code);
  46. refURL.put("redirect_uri",input.redirect_uri);
  47. refURL.put("client_id",input.client_id);
  48. refURL.put("scope",input.scope_field);
  49. refURL.put("state",state);
  50. refMap = Map();
  51. refMap.put(refURL);
  52. refStr = refMap.toString();
  53. refreshURL = encodeURL(refStr);
  54. // - Creator Response Mapping - //
  55. // Authorization //
  56. requestAuth = getURL(authEnc);
  57. authMap = requestAuth.toMap();
  58. // Request Authorization Code //
  59. requestCode = getURL(tokenEnc);
  60. codeMap = requestCode.toMap();
  61. getCode = codeMap.get("code");
  62. input.code = getCode;
  63. // Request Refresh //
  64. requestRefresh = getUrl(refreshURL);
  65. requestMap = requestRefresh.toMap();
  66. getRefreshToken = requestMap.get("refresh_token");
  67. input.refresh_token = getRefreshToken;
  68. // End OAUTH //



Challenges/Goals/Requests/"HELP!!!"


  • Would really help if there was a fully explained, step-by-step example of how to implement OAUTH 2.0 interchange between Creator and an external service. 

  • Goal: Learn OAUTH 2.0 capabilities available within Creator, using Deluge, for integration with other 3rd party CRMs (Hubspot & Infusionsoft for example)

  • Absolute end-goal

    • Successful OAUTH 2.0 interchange, catching the refresh_token, and updating the refresh token every 21 hours.

Thanks to anyone who provides any insight!