Jump to content

Recommended Posts

I was wondering if there was a way to sign into a .Net Passport account with my server using PHP.  I found a script online that lets me sign in and authenticates and says it was successful, but I don't think it works, or at least not for what I want it to work for.  There's a page I want to be able to access that requires that you sign into a .Net account, I could retrieve a lot of information that right now I have to manually put in, if I could simply access this page.

 

Does anyone know a way I can accomplish this?  I don't have an extensive knowledge of cURL, I use the snoopy library to retrieve pages from offsite.  I also don't know how to send form data to another site or to make my server into a client on the target page so that it appears like my server is simply signing in as a computer would.

 

Please, any help with this would be fantastic.

Link to comment
https://forums.phpfreaks.com/topic/159563-sign-in-to-net-passport-using-php/
Share on other sites

you can achieve all this using curl.  you will need to find the action of the form that you normally sign-in with - replicate that behaviour by using curl to post your username and password to the page.

 

there is a fair bit of work involved following that.  You need to monitor the returned data and see where its re-driecting you to and with what data (cookie, get, post etc.) and monitor that.

 

Its not difficult - just time consuming...

I said that I don't know anything about cURL or how to use it.  I know that I'll have to use it, I just don't know how.  The small scriptlet that I have uses cURL but I can't make heads or tails of it.  If someone could help me by walking me through what I need to do I'd be thankful.

Not to be a jerk, I do appreciate the help, but:

 

I found a script online that lets me sign in and authenticates and says it was successful' date=' but I don't think it works, or at least not for what I want it to work for[/quote']

 

I'm already using that and I don't know how to implement the ability to not just sign into the system but to be able to access pages that require that you be signed in.  I want to access a page on Bungie.net (the creators of Halo 3) to get the achievements a certain player has unlocked in Halo 3, but you have to be signed in to get to that page.  I tried authenticating using the script that you linked to, then using the snoopy library to retrieve that page and it just doesn't work, it still says I have to be signed in.  I don't know enough about cURL to tell it to use the credentials I'm supplying as the authentication method.

  • 3 weeks later...

I never got the help I needed with this...I know it's possible because there are services in place already that do something like this.  At the very least could someone help me figure out how to make the code posted by premiso work for what I need to do.  Basically I need to grab a page that's only accessible if you're signed into .net.

what does your curl script look like so far ? and whats the url your trying to get into?

 

Possible Reasons for people not replying might be that they want to see code (you making an attempt) and maybe even the URL of the page you might be trying to cURL.....because without either, its almost like asking someone to write code from scratch for you for a URL we dont even know...

 

I'm willing to help you out because im a bit intrigued by cURL....we can figure this out...if your up for it...

Well I'm using the code from the link that premiso posted above, but all that does is return a yes or no if the login was successful.  I changed it a little bit to accept GET values from the url to provide the login details but that's it.  I don't know how to actually get the page I need to get and parse it WHILE logged into the .net service, then log out when I'm done.  I've never been good at cURL (actually that's an overstatement, I've used it once).  I use the snoopy library of file_get_contents to retrieve offsite pages, and I don't know how to use the snoopy library to sign into .net.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.