synaptic-cl / jumpcloud_aws

Command to generate credentials for aws-cli when you have SAML authentication with JumpCloud
MIT License
6 stars 3 forks source link

Not getting valid form data after all 302s #8

Open Marakai opened 5 years ago

Marakai commented 5 years ago

I'm receiving an error in both direct call and container that "response did not contain a valid SAML assertion" despite valid username/email and password (verified via console), so I went to single stepping through with an IDE.

formresponse = session.get(url, verify=True)

returns a 200, so all is still well here.

idpauthformsubmiturl contains https://console.jumpcloud.com/login?context=sso&redirectTo=saml2%2Faws after the 302s which seems correct, however

formsoup = BeautifulSoup(formresponse.text, "html.parser")

doesn't seem to contain what it's looking for:

<!DOCTYPE html>
<html class="jc-ux2" lang="en"><head><title>JumpCloud</title><link href="img/favicon.ico" rel="icon"/><meta content="text/html; charset=utf-8" http-equiv="content-type"/><meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/><meta content="#003e52" name="theme-color"/><link href="jumpcloud-login.4b1bcb1a.css" rel="stylesheet"/></head><body class="login-viewport" style="background-color:#063240;"><div class="login-container"><div class="login-content"></div></div><script src="jumpcloud-login.afd379c8.js"></script><script>/* Add Google Tag Manager to the /login page when not running locally */
(function(w, d, s, l, i) {
  if (/localhost/.test(window.location)) {
    return;
  }
  w[l] = w[l] || [];
  w[l].push(
    {
      'gtm.start': new Date().getTime(),
      event: 'gtm.js'
    }
  );
  var f = d.getElementsByTagName(s)[0],
    j = d.createElement(s),
    dl = l != 'dataLayer' ? '&l=' + l : '';
  j.async = true;
  j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
  f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-TCQM2R');</script></body></html>

As a result the two find_all() operations fail, meaning the loops return no matches and the POST returns with a 405, unsurprisingly.

aflatto commented 5 years ago

I am trying to tool too, and encountered the same issue.

Sami-svmx commented 5 years ago

Encountered same issue while using this tool