Documentation
  • Overview
  • Usage Guidelines
  • iOS SDK Integration Guide
  • Android SDK Integration Guide
  • Web SDK Integration Guide
    • Example Web SDK Integration
  • Golang SDK Integration Guide
  • React Native SDK Integration Guide
  • Flutter SDK Integration Guide
  • WordPress Plugin Integration Guide
  • Discord Bot Integration Guide
  • FAQ
  • Support
  • Once you hit scale - Fees
  • Adjust language & default country code
  • SMS Terms and Conditions
  • Privacy-Policy
Powered by GitBook
On this page
  • Developer Console
  • WebLoginUrl API Call
  • Callback URL

Was this helpful?

  1. Web SDK Integration Guide

Example Web SDK Integration

Django Implementation of HumanID SSO

PreviousWeb SDK Integration GuideNextGolang SDK Integration Guide

Last updated 3 years ago

Was this helpful?

Developer Console

Acquire CLIENT-ID, CLIENT-SECRET, and set-up redirect URLs on the App Details page by registering your app through .

WebLoginUrl API Call

Create a view function that will perform a POST API request and render HTML:

#YOUR_APP/views.py
def homepage(request):
    headers = {'client-id':'CLIENT_ID','client-secret':'CLIENT_SECRET'}
    response=requests.post('https://core.human-id.org/v0.0.3/server/users/web-login',headers=headers)
    data=response.json()
    return render(request,'trial/homepage.html',
    {
        'data':data
    })

Create a HTML page:

<!YOUR_APP/templates/homepage.html>
{%block content%}
<div>
<p>{{data}}</p>
<p><a href={{data.data.webLoginUrl}}>{% include 'anonymous-login.svg.html'%}</a></p>
</div>
{%endblock%}

Callback URL

After a user successfully logs in through humanID. The user will be redirected to the URL specified in the developer console on the App Details page.

Create a function that will take the exchange token in that URL and make another API request to acquire a unique User ID.

#YOUR_APP/views.py
def callback(request):
    headers = {'client-id':'CLIENT_ID','client-secret':'CLIENT_SECRET'}
    token = request.GET.get('et')
    response= requests.post('https://core.human-id.org/v0.0.3/server/users/exchange',headers= headers,data={'exchangeToken':token})
    data=response.json()
    return render(request,'trial/callback.html',
    {
        'data':data
    })
https://developers.human-id.org/home/