{"__v":18,"_id":"55ffcedffeaf310d007dd6d6","api":{"auth":"required","params":[],"results":{"codes":[]},"settings":"","url":""},"body":"The Rublon SDK libraries are a client-side implementations of the [Rublon](https://rublon.com/) authentication service written in C#, Java, PHP and Python including methods for connecting with the Rublon API  and embedding the service's GUI in a HTML-based environment. It forms a convenient C#, Java, PHP or Python coding language facade for the service's REST interface.\n\n##Use cases\n\nRublon provides an additional security layer:\n\n1. **during logging in to your system**, adding a second (or additional) authentication factor,\n2. **while conducting a security-sensitive transactions**, providing a user the means for identity confirmation before changing passwords or conducting a money transfer.\n\nTo be able to perform an additional authentication using Rublon, the user must first be authenticated in a different way, e.g. with a username and password. It is a necessary step, because upon Rublon's initialization the service must receive certain information about the user:\n\n- a unique Id, stored in the system (hereinafter called **the integrated system**) implementing the Rublon service,\n- the user's email address.\n\nTo experience the full measure of two-factor authentication, the end-user should install the Rublon mobile app, available on all leading smartphone systems. However, having those with older phone devices in mind or those who do not want to install any additional apps on their phones, we prepared a Email2FA process which does not require using an additional device of any kind.\n\n##Principles of operation\n\n###User protection\n\nUser protection is active when a user's email address in the integrated system can be matched to a user in the Rublon service. For this purpose, the user's email is sent to Rublon servers.\n\n1. If the email is matched to an existing Rublon account, the user's identity can be confirmed using Rublon.\n2. Otherwise, if the user does not possess a Rublon account (the email could not be matched), Rublon will use the Email2FA process, trying to verify the user's identity by sending a confirmation email message to his email address.\n\n###Identity confirmation\n\nIf the library finds an active user protection, a URL address pointing to Rublon servers will be generated. The user's web browser must be then redirected to that URL in order to carry out the identity confirmation.\n\nIf the web browser is the user's Trusted Device, the authentication will be performed automatically and invisibly. Otherwise, the user will be asked to scan a QR code using the Rublon mobile app or to click the verification link sent to his email address, upon which the authentication will be performed.\n\n###Return to the integrated system\n\nAfter a successful authentication, the web browser will be redirected to a callback URL address which points to the integrated system servers. The integrated system should intercept that URL, retrieve its params and finalize the authentication using this library.\n\n##First steps\n\nTo start using the Rublon SDK library you should:\n\n- install the Rublon mobile app on your smartphone, create a new account and confirm your email address, \n- visit the Rublon [Developer Area](https://developers.rublon.com/) at [developers.rublon.com](https://developers.rublon.com/) and log in by clicking the \"Developer Dashboard\" button, and scanning the QR code that will appear using the Rublon mobile app, \n- go to the \"Add website\" form (Dashboard -> Add website) and fill in the required fields, \n- copy the provided **system token** and **secret key**, which will be used to identify the integrated system and verify the authenticity and integrity of the messages exchanged with Rublon API.\n\n##Examples' assumptions\n[block:html]\n{\n  \"html\": \"<div>\\n\\n  <!-- Nav tabs -->\\n  <ul class=\\\"nav nav-tabs langnav\\\" role=\\\"tablist\\\">\\n    <li role=\\\"presentation\\\" class=\\\"active\\\"><a href=\\\"#php\\\" aria-controls=\\\"php\\\" role=\\\"tab\\\" data-toggle=\\\"tab\\\">PHP</a></li>\\n    <li role=\\\"presentation\\\"><a href=\\\"#net\\\" aria-controls=\\\"net\\\" role=\\\"tab\\\" data-toggle=\\\"tab\\\">.NET</a></li>\\n    <li role=\\\"presentation\\\"><a href=\\\"#java\\\" aria-controls=\\\"java\\\" role=\\\"tab\\\" data-toggle=\\\"tab\\\">Java</a></li>\\n    <li role=\\\"presentation\\\"><a href=\\\"#python\\\" aria-controls=\\\"python\\\" role=\\\"tab\\\" data-toggle=\\\"tab\\\">Python</a></li>\\n  </ul>\\n\\n  <!-- Tab panes -->\\n  <div class=\\\"tab-content\\\">\\n    <div role=\\\"tabpanel\\\" class=\\\"tab-pane active\\\" id=\\\"php\\\">\\n   <br/>\\n   <p>In the following examples we assume the existence of the superglobal session array <code>$_SESSION</code>, which has access to an object storing the currently logged in user data.</p>\\n    </div>\\n    <div role=\\\"tabpanel\\\" class=\\\"tab-pane\\\" id=\\\"net\\\">\\n   <br/>\\n   <p>In the following examples we assume the existence of the session handler object <code>Session</code>, which has access to an object storing the currently logged in user data, the <code>Request</code> object which is an instance of HTTP request and the <code>Response</code> object which is an instance of HTTP response.</p>    \\n    </div>\\n    <div role=\\\"tabpanel\\\" class=\\\"tab-pane\\\" id=\\\"java\\\">\\n   <br/><p>In the following examples we assume the existence of:</p>\\n<ul>\\n<li>the session handler class <code>Session</code>, which has access to\\tan object storing the currently logged in user data,</li>\\n<li>the <code>HttpServer</code> class which is a simple HTTP server instance,</li>\\n<li>the <code>Database</code> class which is a database interface.</li>\\n  </ul>\\n    </div>\\n    <div role=\\\"tabpanel\\\" class=\\\"tab-pane\\\" id=\\\"python\\\">\\n   <br/><p>In the following examples we assume the existence of the session dictionary <code>session</code>, which has access to an object storing the currently logged in user data.</p>\\n    </div>\\n  </div>\\n\\n</div>\\n<style>\\n.langnav > li > a {\\n    padding: 3px 15px;\\n}\\ncaption{\\nmargin:10px;\\n}\\n</style>\"\n}\n[/block]\n##Modifying the library\n\nThe `Rublon2Factor` class implements a few public methods, which, when needed, can be overriden with inheritance.\n\nWe strongly discourage you from modifying any part of the library, as it usually leads to difficulties during future library updates. If you need to change the flow or internal structure of the `Rublon2Factor`, `Rublon2FactorGUI` or `Rublon2FactorCallback` classes, don't hesitate to subclass them according to your needs.","category":"55ffceca0e2b090d008633b2","createdAt":"2015-09-21T09:33:19.235Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":25,"project":"55edea207145f717001ac12c","slug":"sdk-introduction","sync_unique":"","title":"Introduction","type":"basic","updates":[],"user":"55ede9ed1452cd0d009e5e6b","version":"55edea207145f717001ac12f","childrenPages":[]}
The Rublon SDK libraries are a client-side implementations of the [Rublon](https://rublon.com/) authentication service written in C#, Java, PHP and Python including methods for connecting with the Rublon API and embedding the service's GUI in a HTML-based environment. It forms a convenient C#, Java, PHP or Python coding language facade for the service's REST interface. ##Use cases Rublon provides an additional security layer: 1. **during logging in to your system**, adding a second (or additional) authentication factor, 2. **while conducting a security-sensitive transactions**, providing a user the means for identity confirmation before changing passwords or conducting a money transfer. To be able to perform an additional authentication using Rublon, the user must first be authenticated in a different way, e.g. with a username and password. It is a necessary step, because upon Rublon's initialization the service must receive certain information about the user: - a unique Id, stored in the system (hereinafter called **the integrated system**) implementing the Rublon service, - the user's email address. To experience the full measure of two-factor authentication, the end-user should install the Rublon mobile app, available on all leading smartphone systems. However, having those with older phone devices in mind or those who do not want to install any additional apps on their phones, we prepared a Email2FA process which does not require using an additional device of any kind. ##Principles of operation ###User protection User protection is active when a user's email address in the integrated system can be matched to a user in the Rublon service. For this purpose, the user's email is sent to Rublon servers. 1. If the email is matched to an existing Rublon account, the user's identity can be confirmed using Rublon. 2. Otherwise, if the user does not possess a Rublon account (the email could not be matched), Rublon will use the Email2FA process, trying to verify the user's identity by sending a confirmation email message to his email address. ###Identity confirmation If the library finds an active user protection, a URL address pointing to Rublon servers will be generated. The user's web browser must be then redirected to that URL in order to carry out the identity confirmation. If the web browser is the user's Trusted Device, the authentication will be performed automatically and invisibly. Otherwise, the user will be asked to scan a QR code using the Rublon mobile app or to click the verification link sent to his email address, upon which the authentication will be performed. ###Return to the integrated system After a successful authentication, the web browser will be redirected to a callback URL address which points to the integrated system servers. The integrated system should intercept that URL, retrieve its params and finalize the authentication using this library. ##First steps To start using the Rublon SDK library you should: - install the Rublon mobile app on your smartphone, create a new account and confirm your email address, - visit the Rublon [Developer Area](https://developers.rublon.com/) at [developers.rublon.com](https://developers.rublon.com/) and log in by clicking the "Developer Dashboard" button, and scanning the QR code that will appear using the Rublon mobile app, - go to the "Add website" form (Dashboard -> Add website) and fill in the required fields, - copy the provided **system token** and **secret key**, which will be used to identify the integrated system and verify the authenticity and integrity of the messages exchanged with Rublon API. ##Examples' assumptions [block:html] { "html": "<div>\n\n <!-- Nav tabs -->\n <ul class=\"nav nav-tabs langnav\" role=\"tablist\">\n <li role=\"presentation\" class=\"active\"><a href=\"#php\" aria-controls=\"php\" role=\"tab\" data-toggle=\"tab\">PHP</a></li>\n <li role=\"presentation\"><a href=\"#net\" aria-controls=\"net\" role=\"tab\" data-toggle=\"tab\">.NET</a></li>\n <li role=\"presentation\"><a href=\"#java\" aria-controls=\"java\" role=\"tab\" data-toggle=\"tab\">Java</a></li>\n <li role=\"presentation\"><a href=\"#python\" aria-controls=\"python\" role=\"tab\" data-toggle=\"tab\">Python</a></li>\n </ul>\n\n <!-- Tab panes -->\n <div class=\"tab-content\">\n <div role=\"tabpanel\" class=\"tab-pane active\" id=\"php\">\n <br/>\n <p>In the following examples we assume the existence of the superglobal session array <code>$_SESSION</code>, which has access to an object storing the currently logged in user data.</p>\n </div>\n <div role=\"tabpanel\" class=\"tab-pane\" id=\"net\">\n <br/>\n <p>In the following examples we assume the existence of the session handler object <code>Session</code>, which has access to an object storing the currently logged in user data, the <code>Request</code> object which is an instance of HTTP request and the <code>Response</code> object which is an instance of HTTP response.</p> \n </div>\n <div role=\"tabpanel\" class=\"tab-pane\" id=\"java\">\n <br/><p>In the following examples we assume the existence of:</p>\n<ul>\n<li>the session handler class <code>Session</code>, which has access to\tan object storing the currently logged in user data,</li>\n<li>the <code>HttpServer</code> class which is a simple HTTP server instance,</li>\n<li>the <code>Database</code> class which is a database interface.</li>\n </ul>\n </div>\n <div role=\"tabpanel\" class=\"tab-pane\" id=\"python\">\n <br/><p>In the following examples we assume the existence of the session dictionary <code>session</code>, which has access to an object storing the currently logged in user data.</p>\n </div>\n </div>\n\n</div>\n<style>\n.langnav > li > a {\n padding: 3px 15px;\n}\ncaption{\nmargin:10px;\n}\n</style>" } [/block] ##Modifying the library The `Rublon2Factor` class implements a few public methods, which, when needed, can be overriden with inheritance. We strongly discourage you from modifying any part of the library, as it usually leads to difficulties during future library updates. If you need to change the flow or internal structure of the `Rublon2Factor`, `Rublon2FactorGUI` or `Rublon2FactorCallback` classes, don't hesitate to subclass them according to your needs.