Authentication Service
| Remote User Authentication | |||||||||||||||||||||||||||||||
|
The Remote User Authentication service allows for mensa websites to authentication mensa members. Authentication is done by calling one of the authentication files : http://indianmensa.org/db/services/auth/auth.php or http://indianmensa.org/db/services/auth/authXML.php.
Example
To authenticate a user with the Membership No (The Membership No acts as the username, uniquely identifying each user) 11000012 and password testpass, you will make a call as follows : If your website is chapter specific where you want to limit your users to a certain chapter you may use the City parameter. Each chapter is assigned a 2 character code as shown in the table below :
Example
To authenticate a user with the Membership No 11000012, password testpass and from the Mumbai chapter, you will make a call as follows : The resulting page is a plain text file with 2 lines. The first line gives the result code and the second line gives a description. Below is a list of the codes and their descriptions
The file http://indianmensa.org/db/services/auth/authXML.php returns the same output but parses it as XML. How to use these files for authentication. Performing authentication with the help of these files is simple. You can write a function that calls this page and read its output.
Code Example
Say you are using PHP, your function would be as follows. <?php Now you can call this function to authenticate users.
<php This was merely an example using the plain text file. If you wish to you can use the XML file authXML.php. The GET parameters remain the same only the output format differs. The XML file can be used with PHP's XML functions or for that matter with any other language that supports reading XML. The main reason for including the XML file was to support future projects that may incorporate AJAX.
Example AJAX Implementation (using authXML.php)
Username : Password : |
|||||||||||||||||||||||||||||||








