[Include] TFA_SAMP - 1st two-factor authentication method for SA-MP.
#1

TFA_SAMP - 1st two-factor authentication method for SA-MP.
A huge thanks to Authy (https://www.authy.com/) for providing the web APIs.
Include release under GPL v2 OSL (open source license) - click here for more information.
Part of the include is made in PHP.


Hello everyone.

Recently I was thinking of a new include to release, and I thought about a two-factor authentication method for SA-MP, something like it has never existed before. This include does not directly provide the authentication method, it is just a way to communicate with the service that provides so, which in this case is Authy.

Authy provides also free-plans for development or fairly small communities.
Visit https://www.authy.com/ for more information.

If you don't know what a two-factor authentication method is, read this page.

However, here's a short description.
Quote:

Multi-factor authentication (also MFA, Two-factor authentication, TFA, T-FA or 2FA) is an approach to authentication which requires the presentation of two or more of the three authentication factors: a knowledge factor ("something only the user knows"), a possession factor ("something only the user has"), and an inherence factor ("something only the user is"). After presentation, each factor must be validated by the other party for authentication to occur.

This include allows you to communicate with API requests to Authy's servers and to use your cellphone as second factor, which is the possession factor. In order to be it two-factor, thus increasing the account' security, you must ask for the password and the token sent via SMS or taken by the phone application.

So, what is Authy? Authy is what gives us the API to communicate with the server and to send the SMS / verify the token taken by your phone.

If you are worried about security, the API requests through the production method are sent through HTTPS requests, and all the information are not saved in any TFA_SAMP database but in Authy's databases which are completely safe and secure.

Available Functions
  • TFASAMP::prepareConnection(host[], password[], api_key[], type[] = "production", bool:tfa_debug = false)
  • TFASAMP::createUser(playerid, email[], cellphone[], area_code[] = "1")
  • TFASAMP::verifyToken(playerid, user_id, token[], bool: force = true)
  • TFASAMP::setPlayerUserID(playerid, userid)
  • TFASAMP::getPlayerUserID(playerid)
Available Callbacks
  • TFASAMP::OnTokenVerify(playerid, result)
Documentation

You may find here the updated functions documentation.

Bug Reporting

Please use GitHub's issues to report bugs by clicking here.

Contributions

Please use GitHub's pull requests to give a contribute by clicking here.

Example

You may find an example of the include here.

Requirements

You need to install this or the include will not work.
You also need y_hooks and y_stringhash from YSI library.

For any other question, feedback or anything else feel free to answer this thread, and don't forget to contribute on GitHub, if you'd like to!

Cheers.
Reply


Messages In This Thread
TFA_SAMP - first two-factor authentication method for SA-MP. - by GiamPy. - 23.10.2013, 20:41
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by GiamPy. - 24.10.2013, 00:26
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by iZN - 24.10.2013, 09:22
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by GiamPy. - 24.10.2013, 10:51
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by Tamer - 24.10.2013, 13:54
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by Akira297 - 24.10.2013, 14:20
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by GiamPy. - 24.10.2013, 15:03
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by GiamPy. - 26.12.2013, 15:35
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by GiamPy. - 26.12.2013, 21:36
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by GiamPy. - 27.12.2013, 01:14
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by Djole1337 - 27.12.2013, 01:33
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by GiamPy. - 27.12.2013, 10:31
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by GiamPy. - 27.12.2013, 11:10
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by GiamPy. - 27.12.2013, 11:34
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by GiamPy. - 27.12.2013, 11:44
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by feartonyb - 28.12.2013, 01:07
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by Alphlax - 28.12.2013, 01:42
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by GiamPy. - 28.12.2013, 14:18
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by GiamPy. - 30.12.2013, 01:32
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by Alphlax - 30.12.2013, 02:01
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by GiamPy. - 30.12.2013, 12:35
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by GiamPy. - 02.01.2014, 18:17
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by Battlezone - 03.01.2014, 21:41
Re: TFA_SAMP - 1st two-factor authentication method for SA-MP. - by GiamPy. - 31.01.2014, 14:06

Forum Jump:


Users browsing this thread: 1 Guest(s)