Tradable Bits and Authentication Flow Summary

Tradable Bits provides fully functional adapter for OAUTH, which can be integrated into your website for the purposes of authentication and identity management. Both social and email based authentication options are supported, however, each flow/option has some specifics, which has to be considered during implementation.

Social Vs Email login

Social only login is probably the simplest one to implement. Once your social app is configured and approved if needed by the network, you can add a link, similar to the one below and upon redirect back - you will receive a proper session_uid, which will ensure identity:


<a href="https://tradablebits.com/crm/oauth?login_type=facebook&account_id=1234&redirect_url=http://test.com/callback">
Login
</a>
            

Email login is possible as well, but you need to ensure you integrated properly password reset and email confirmation logic. Password reset can be provided by our form, or on your side with help of API. Another component you need to consider is to generate welcome emails for new registration to confirm valid emails.

Oauth Endpoint

Provide an endpoint on your side that can accept the redirect from our authentication server and retrieve the session information via the backend call to API. This option is great for clients who have their own server and want more control over their user data storage.

We support OAUTH 1.0 authentication endpoint.

Redirect Example


<a href="https://tradablebits.com/crm/oauth?account_id=1234&redirect_url=http://test.com/callback">
Login
</a>
            
  • account_id Tradable Bits Account ID. This argument is mandatory.
  • login_type Selected network to login
  • redirect_url Redirect URL to send user to upon successful authentication.This argument is mandatory.

Callback Handler Example (Python/Django)


function callback(request):
    code = request.GET.get('code')
    api_key = "12345"
    account_id = "12345"
    redirect_url = "http://test.com/callback"
    parms = {"code":code,"api_key":api_key,"account_id":account_id,"redirect_url":redirect_url}
    token_url = "https://tradablebits.com/crm/access_token?%s" % urllib.urlencode(parms)
    with contextlib.closing(urllib2.urlopen(token_url, timeout=10)) as r:
        res = r.read()
        session = json.loads(res)
...
  • account_id Tradable Bits Account ID.
  • redirect_url Redirect URL to send user to upon successful authentication.
  • api_key Secret Key as configured on the manage centre page.
  • code Url request will include "code" query argument which can be used to retrieve session object.

Password Reset

When your clients forget their passwords, we've got you covered. Our system will send out a standard email that will allow them to resolve the issue. However, you may want to override our default "Reset Password" email and widget with your own branding or user flow. Here's how:

  • Find the user's email and look them up via the CRM API.
  • For fan update endpoint set the reset_uid to true. Upon success, the call will return unique GUID as part of the fan structure.
  • Generate an email that links to OAUTH endpoint with additional parameters: email and reset_uid.
  • Widget will open reset form and guide the user through the process.

<a href="https://tradablebits.com/crm/oauth?account_id=1234&email=test@test.com&reset_uid=5a4d7c07-cbf6-4aed-b1ea-a6ff609d561a&redirect_url=http://test.com/callback">
Reset Password
</a>