Atavism Blog

Atavism Blog

Here you will find Blog posts about atavism

  • Home
    Home This is where you can find all the blog posts throughout the site.
  • Categories
    Categories Displays a list of categories from this blog.
  • Tags
    Tags Displays a list of tags that have been used in the blog.
  • Bloggers
    Bloggers Search for your favorite blogger from this site.
  • Team Blogs
    Team Blogs Find your favorite team blogs here.
  • Login
    Login Login form

Remote Account Authentication

Posted by on in Uncategorized
  • Font size: Larger Smaller
  • Hits: 1779
  • 0 Comments
  • Subscribe to this entry
  • Print

With the release of v2.1.1 developers will be able to connect their Atavism server account authentication to external systems such as a website or database. This will allow you to manage or control who has access to your game without making changes to the atavism master database. It also means those with a group of followers who have accounts on a website can use their website accounts to log into the game. The only challenge is it requires a bit of setup on the remote system to allow Atavism to get the data it needs.

The atavism server has built in support to send a request to a php page and get a response back to verify an account. The rest of this blog post is going to cover how to set that php page up to talk to your website database and how to get atavism to talk to your php page.

Note: There is also a skeleton file to work with direct remote database connections which will be completed later (but any keen programmers can modify it easily if they have access to the AGIS code – see RemoteDatabaseAccountConnector.java in the util package).

Setting up the PHP Page:

The Atavism server sends two parameters to the php page: 'user' and 'password'. You need to use the POST function to get the properies. i.e:

$user = $_POST["user"];

$password = $_POST["password"];

From here your php page will do whatever it needs to verify the username and password.

It then must echo either a “Success” or a fail message which the Atavism server will pickup. For example, I have a password check that echoes Success when the passwords match, otherwise Fail:

if ($password === $passnya) {

    echo "Success";

} else {

    echo "Fail";

}

That is pretty much all you need to get the php side going. The hard part is creating the logic to verify the account details. To help you setup your php page, an example php script is given on the wiki page: http://atavismonline.com/wiki/doku.php?id=remote_php_connector

 Getting the Atavism server to communicate with your PHP page:

A remote connector can be set in the auth_server.py file in the server files/bin folder. The following 3 lines need to be added or edited (which already exist in the file and just need the # symbol removed):

connector = RemotePhpAccountConnector()

connector.setUrl("http://www.yourdomain.com/verifyAccount.php")

ms.setRemoteConnector(connector)

Replace the url specified with the address of the php file you have uploaded and you are ready to go.

Note: To use other connectors, substitute in the different class name and the set functions.

 We will be adding this to the wiki as well. That's if for this week. Next week's blog won't be quite so technical, so don't worry if this is all a bit confusing.

0

Comments

  • No comments made yet. Be the first to submit a comment

Leave your comment

Guest
Guest Saturday, 29 April 2017

Intel

Unity

S5 Box

Sign On