HaLo2FrEeEk Posted May 25, 2009 Share Posted May 25, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/159563-sign-in-to-net-passport-using-php/ Share on other sites More sharing options...
ToonMariner Posted May 25, 2009 Share Posted May 25, 2009 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... Quote Link to comment https://forums.phpfreaks.com/topic/159563-sign-in-to-net-passport-using-php/#findComment-841692 Share on other sites More sharing options...
HaLo2FrEeEk Posted May 25, 2009 Author Share Posted May 25, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/159563-sign-in-to-net-passport-using-php/#findComment-841947 Share on other sites More sharing options...
premiso Posted May 25, 2009 Share Posted May 25, 2009 Google does tend to help cause chances are someone has already done what you want: http://www.cstruter.com/replyblog.php?ContentID=41 Check out that for a script that authenticates to .NET Passport. Quote Link to comment https://forums.phpfreaks.com/topic/159563-sign-in-to-net-passport-using-php/#findComment-841955 Share on other sites More sharing options...
HaLo2FrEeEk Posted May 27, 2009 Author Share Posted May 27, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/159563-sign-in-to-net-passport-using-php/#findComment-842934 Share on other sites More sharing options...
HaLo2FrEeEk Posted June 11, 2009 Author Share Posted June 11, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/159563-sign-in-to-net-passport-using-php/#findComment-853620 Share on other sites More sharing options...
DarkSuperHero Posted June 11, 2009 Share Posted June 11, 2009 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... Quote Link to comment https://forums.phpfreaks.com/topic/159563-sign-in-to-net-passport-using-php/#findComment-853838 Share on other sites More sharing options...
HaLo2FrEeEk Posted June 11, 2009 Author Share Posted June 11, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/159563-sign-in-to-net-passport-using-php/#findComment-853937 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.