Hosted Integration (Web Link)

This document explains how to integrate the Authentication flow outside of your web application

Overview

In case you'd rather have the verification process handled outside of your application, we can provide you an URL with a working integration managed directly on Passbase.

You can get here your own customizable organization slug. e.g. https://verify.passbase.com/YOURCOMPANY

https://verify.passbase.com/:organization_slug

And example of the verification via link feature is our Passbase Demo.

Customization, Passing & Prefilling Data

In order to customize the behavior of the component according to your needs, you can pass a base64 encoded parameters object in the request.

This would look then in practice like

// Your Link
https://verify.passbase.com/:organization_slug
// Your link including an encoded string for customizations
https://verify.passbase.com/:organization_slug?p={BASE64_ENCODED_STRING}

The encoded object shall be a JSON object consisting of the following (optional) key-value associations:

Key

Value

additional_attributes

A JSON RFC-7159 compliant object where to store useful references for your application (User IDs, etc.)

prefill_attributes

email: Populate this field if you already know your users' email address to speed up the authentication flow.

country: An ISO-3166 compliant country code. Populate this field if you already know your users' nationality to speed up the authentication flow.

Example How To Encode

If we look at an example where you want to pass in your user's email and maybe preselect the country for the top document in the list to Germany, you should do the following:

JavaScript
Python
Ruby
JavaScript
const prefillAttributes = {
prefill_attributes: {
email: "user@email.de",
country: "de"
}
}
const objJsonStr = JSON.stringify(prefillAttributes);
const objJsonB64 = Buffer.from(objJsonStr).toString("base64");
// Your Link
const link = "https://verify.passbase.com/" + "YOUR_SLUG" + "/?p=" + objJsonB64
// Result:
// https://verify.passbase.com/YOUR_SLUG/?p=eyJwcmVmaWxsX2F0dHJpYnV0ZXMiOnsiZW1haWwiOiJ1c2VyQGVtYWlsLmRlIiwiY291bnRyeSI6ImRlIn19
Python
import json
import base64
yourCompanySlug = "mathias"
yourPassbaseLink = "https://verify.passbase.com/" + yourCompanySlug
prefillAttributes = {
"prefill_attributes": {
"email": "user@email.de",
"country": "de"
}
}
jsonString = json.dumps(prefillAttributes)
encoded = base64.b64encode(jsonString.encode('utf-8'))
encodedStr = str(encoded, "utf-8")
link = yourPassbaseLink + '?p=' + encodedStr
# Result
# https://verify.passbase.com/YOUR_SLUG?p=eyJwcmVmaWxsX2F0dHJpYnV0ZXMiOiB7ImVtYWlsIjogInVzZXJAZW1haWwuZGUiLCAiY291bnRyeSI6ICJkZSJ9fQ==
Ruby
require "base64"
require 'json'
yourCompanySlug = "mathias"
yourPassbaseLink = "https://verify.passbase.com/" + yourCompanySlug
preFillAttributes = {'prefill_attributes' => {
'email' => 'user@email.de',
'country' => 'de'
}}
encoded = Base64.strict_encode64(preFillAttributes.to_json)
link = yourPassbaseLink + "?p=" + encoded
# Result
# https://verify.passbase.com/YOUR_SLUG/?p=eyJwcmVmaWxsX2F0dHJpYnV0ZXMiOnsiZW1haWwiOiJ1c2VyQGVtYWlsLmRlIiwiY291bnRyeSI6ImRlIn19

We also published a full example that you can run online in Javascript, Python and Ruby.