1

The login page is this: https://login.procore.com/

I feel like I'm close to getting it to work, but have hit a brick wall due to a lack of understanding of login procedures. Here is the code so far, without the actual sign in information.

$r=Invoke-WebRequest https://login.procore.com/ -SessionVariable fb

$form = $r.Forms[0]

$form.Fields["session_email"] = "xxxxxxxxx"
$form.Fields["session_password"] = "xxxxxxxx"

$r=Invoke-WebRequest ('https://login.procore.com/' + $form.Action) -WebSession $fb -Method $form.Method  -Body $form.Fields 

Could someone help me understand what is missing? I did notice that $form.Fields contains an empty field named: session_sso_target_url, but honestly have no clue what it means, or how to use it.

  • Possible duplicate of [How do you get table data from a website after you login using powershell?](https://stackoverflow.com/questions/52374548/how-do-you-get-table-data-from-a-website-after-you-login-using-powershell) – Maximilian Burszley Mar 17 '19 at 17:53

1 Answers1

0

You've given me insufficient info to provide a complete answer, because I don't have a login and don't see a way to sign up for a free trial, and you haven't stated what kind of error you are getting.

I hazard a guess that session_sso_target_url relates to federation, which is semantically related to single sign-on (SSO). In federation, an application is configured to accept logins from another login domain. The obvious example in corporateland is ADFS, but any time you see an app that says Login with Facebook or Login with Google, that's the same thing. Federation is a big topic. The meaning of having a target URL is that the browser is often redirected to the identity provider (ADFS / FB / GOOG etc) with the callback URL that the browser should come back to once it is authenticated.

Suffice it to say that I suspect that you need do nothing with this field! And the reason I say this is because I hit it with Fiddler.

You should know about Fiddler. It is a cost-free debugging proxy from Telerik. I am not affiliated with Telerik, but I owe them hours of saved time when web scraping. (It is not the only tool for the job, and if any moderator deems that I am violating site rules, I will be happy to sanitise this post.)

Do this:

  • install Fiddler
  • Set it up to listen on 127:0.0.1:whatever and to be your system proxy
  • in Tools > Options > HTTPS, set it to decrypt HTTPS (this will replace all certs with auto-generated self-signed ones, so do not leave this running while you perform other tasks)
  • Set your filters to only include traffic to *.procore.com
  • Log in through your browser - you should now see web traffic in the left-hand pane. This captured traffic is your baseline.
  • Select any one web request and look at the Inspectors tab in the right-hand pane. You can look at Raw, Forms, Cookies, etc. This gives you a low-level view of what your client is doing.
  • Run your code snippet. You can now compare the differences between the baseline and your code, and adjust accordingly.
FSCKur
  • 560
  • 4
  • 12
  • 1
    I installed and ran Fiddler, and the session_sso_target_url is empty just like you said. The login process for Procore seems way too complicated for what I know how to do. Will have to abandon this project for now. Thank you for your answer, you got me a lot closer to my goal, but my lack of experience in this area is holding me back. –  Mar 17 '19 at 22:14