john smith 1924 Veteran Posted August 31, 2004 Veteran Share Posted August 31, 2004 Neowin coders / members / project leaders, We've developed a system to allow external projects in-directly linked to neowin to authenticate users in a secure manner. Based around a ticket system, you can now check if a user says who they are. Below you can find demo code, and a more advanced explanation of how the system works. If you have any feedback on the system, please post below. The data we return to sites (username, user group, email) is subject to change. Equally, the use of this system is conditional on the pledge that you agree not abuse the information given to you. The system was designed and built by our very own Timdorr (you can thank him via a PM :) ). Explanation of the system An effective system for validating members can be done via tickets. Essentially, it's a 3 stage process. 1. You require a visiting user to prove they are who they say they are (with relation to their neowin membership). You forward them to us (www.neowin.net/login/?url=yoururl.com). Here, they enter username and password. 2. If they enter the correct info, we'll return the user to your site with a ticket. With this ticket, you can now access neowin asking for validation (see example code below). This ticket is only valid for 60 seconds (security measure). 3. If the ticket is invalid (for whatever reason) we'll return the data "no". If it is valid, we'll return the following data : username, email address, group information (e.g. banned, normal, moderator). From this, you can then proceed with whatever activites the user wants to do on your site, safe in the knowledge that they are who they say they are. Example Code <?php //Neowin Login Tool example code, coded by Sietse and offered freely for use by Neowin.net // Send the user to login if no ticket is found // ---------------------------------------------- //enter your url below - the location of this script - e.g. www.mysite.com/ $myurl = 'http://www.sietse.nu/neowin/'; if(empty($_GET['ticket'])) { ? ?header('Location: https://www.neowin.net/login/?url=' . $myurl); } else { // Check ticket // ----------------- $info = ?explode("\n", file_get_contents('https://www.neowin.net/login/checkticket.php?ticket=' . $_GET['ticket'])); if($info[0] == "no") { ?echo "Sorry, you could not be logged in, check your username and password."; } else { ?// Succesfully logged in, display the given content ?// ------------------------------------------------- ?echo "You've been succesfully logged in..\n ? ?<br /><br />\n<strong>Username:</strong> " . $info[1] . "<br />\n ? ?<strong>E-mail:</strong> " . $info[2] . "<br />\n ? ?<strong>Group:</strong> " . $info[5] . "<br />\n ? ?<strong>Member ID:</strong> " . $info[4] . "<br />\n ? ?<strong>Time Offset:</strong> " . $info[3]; } } ?> An example of the system can be found here : here Please feel free to leave feedback below, as well as links to sites that you've impUPDATE FEB 1, 2009: FEB 1, 2009: We've made some changes to the script. The biggest thing is that it now uses the Finity style, and offers more details. Generally, it feels better. The other thing is for developers of Neowin-based services. You can now pass &img=http://mydomain.com/neowin-login.png on the login URL, and that image will appear at the top left of the site, like so: https://www.neowin.net/login/?img=http://ww...ser%2Fticket%2F It offers that extra bit of branding and clarity to the user. The image you use should be 48px high, and only as wide as you need. There should be 2 or 3 pixels of padding around the image, so really the height is about 42px. Make sure it is a transparent PNG, so our background can be seen through it. Remember, you're branding Neowin, it :ptter look nice :p Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/ Share on other sites More sharing options...
JMann Veteran Posted August 31, 2004 Veteran Share Posted August 31, 2004 Cheers dude. Very nice, this is obviously going to be used for NeoRequest. Thanks. Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584469147 Share on other sites More sharing options...
Hurmoth Posted August 31, 2004 Share Posted August 31, 2004 Yes this is nice (Y) Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584469157 Share on other sites More sharing options...
-=[Blueshadowz]=- Posted August 31, 2004 Share Posted August 31, 2004 Yay nice work :D! Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584469225 Share on other sites More sharing options...
+chorpeac MVC Posted August 31, 2004 MVC Share Posted August 31, 2004 Ok let me see if I can use this. Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584469363 Share on other sites More sharing options...
+chorpeac MVC Posted August 31, 2004 MVC Share Posted August 31, 2004 Ok this should work. Good job One question/suggestion... Could you return the Neowin MemberID also, so on our apps we can link to this: https://www.neowin.net/forum/index.php?showuser=MemberID to display the Neowin Profile page for the user? Lots of users were asking for the ability to look at another Users Neowin profile from within NeoRequest. This would definitely help out! Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584469373 Share on other sites More sharing options...
Tim Dorr Veteran Posted August 31, 2004 Veteran Share Posted August 31, 2004 Added to the end of the list. If there's other metrics that people need, I can add them to the end of the list. (No, I won't add the password hash :p ). Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584469413 Share on other sites More sharing options...
+chorpeac MVC Posted August 31, 2004 MVC Share Posted August 31, 2004 Added to the end of the list. If there's other metrics that people need, I can add them to the end of the list. (No, I won't add the password hash :p ). Ah, one other... Users Timezone Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584469439 Share on other sites More sharing options...
Tim Dorr Veteran Posted August 31, 2004 Veteran Share Posted August 31, 2004 Added :) Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584469474 Share on other sites More sharing options...
Tim Dorr Veteran Posted August 31, 2004 Veteran Share Posted August 31, 2004 one more change: I realize now that people, such as Mr Magoo, have spaces in their names. I've switched it to newline deliminated, so that people with weird characters don't cause a problem :) Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584469496 Share on other sites More sharing options...
+chorpeac MVC Posted August 31, 2004 MVC Share Posted August 31, 2004 Excellent, thanks timdorr Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584469559 Share on other sites More sharing options...
Tim Dorr Veteran Posted August 31, 2004 Veteran Share Posted August 31, 2004 I'll try not to break the protocol in the future, but if I do have to, I'll set up checkuser2.php , checkuser3.php and etc so there's always backwards compatibilty. Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584469624 Share on other sites More sharing options...
+chorpeac MVC Posted August 31, 2004 MVC Share Posted August 31, 2004 Ok, well others can speak up when they use it, but I will plan so that as long as you append to the end, it should be ok. But if you change the label in the front...well then I can see a break. :) Thanks for helping us with this feature! Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584469769 Share on other sites More sharing options...
Marshalus Veteran Posted August 31, 2004 Veteran Share Posted August 31, 2004 one more change: I realize now that people, such as Mr Magoo, have spaces in their names. I've switched it to newline deliminated, so that people with weird characters don't cause a problem :) Nothing about people who are weird characters though, they'll still cause problems. :) Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584469819 Share on other sites More sharing options...
Sietse Veteran Posted August 31, 2004 Veteran Share Posted August 31, 2004 Example fixed (updated) :) Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584470132 Share on other sites More sharing options...
+chorpeac MVC Posted August 31, 2004 MVC Share Posted August 31, 2004 Nothing about people who are weird characters though, they'll still cause problems. :) I think they will still work. ? works... Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584470601 Share on other sites More sharing options...
Sietse Veteran Posted August 31, 2004 Veteran Share Posted August 31, 2004 I don't see the problem either.. :) Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584470606 Share on other sites More sharing options...
JMann Veteran Posted August 31, 2004 Veteran Share Posted August 31, 2004 You know it rocks. :) Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584470610 Share on other sites More sharing options...
matt74441 Posted August 31, 2004 Share Posted August 31, 2004 Awesomeness. I'll have to give this a shot for Neomap. Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584470626 Share on other sites More sharing options...
+chorpeac MVC Posted August 31, 2004 MVC Share Posted August 31, 2004 Awesomeness. I'll have to give this a shot for Neomap. Cool, I was trying to forward this link to you, but Neowin was acting weird, and I didn't get around to it. I thought you might be able to use this too! Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584470658 Share on other sites More sharing options...
matt74441 Posted August 31, 2004 Share Posted August 31, 2004 Cool, I was trying to forward this link to you, but Neowin was acting weird, and I didn't get around to it. I thought you might be able to use this too! Well it wasn't exactly what I was looking for, but I'm sure I could modify it for my needs :) Timdorr, would I be able to get the complete user group list? Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584470677 Share on other sites More sharing options...
Sietse Veteran Posted August 31, 2004 Veteran Share Posted August 31, 2004 https://www.neowin.net/forum/index.php?act=Members A complete list is given in the dropdown box at the bottom. :yes: Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584470769 Share on other sites More sharing options...
+chorpeac MVC Posted August 31, 2004 MVC Share Posted August 31, 2004 OK timdorr... I'm not sure if anyone else is using this yet or not, but maybe something we could put in here to make things a little bit easier... Could we put begin and end character strings to signify begin of data and end of data. I'm just trying to recommend a standardized mechanism. It's currently possible to get the data, but it would be really easy if we can look for certain characters or delimiters so to speak. Hmm...Just something that could/would be consistent. Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584470944 Share on other sites More sharing options...
matt74441 Posted August 31, 2004 Share Posted August 31, 2004 https://www.neowin.net/forum/index.php?act=Members A complete list is given in the dropdown box at the bottom. :yes: I knew about that, but I need the one for banned users as well. Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584471028 Share on other sites More sharing options...
+chorpeac MVC Posted August 31, 2004 MVC Share Posted August 31, 2004 OK wait a second...we could use Regular Expressions to extract this information... Link to comment https://www.neowin.net/forum/topic/211388-neowin-external-login-tool/#findComment-584471085 Share on other sites More sharing options...
Recommended Posts