OneID Button (oneid.js)

The oneid.js button is the easiest way to integrate OneID with your service. Users select their bank from the button and are redirected to the banks app to authorize access to their bank-verified data.

When included on the redirect_uri the oneid.js script will complete a public client journey and retrieve user data.

Example usage

Embed the OneID Button:

   <script
         src="https://public-assets.myoneid.co.uk/latest/oneid.js"
         id="oneid-button"
         data-target="{{ redirect_uri }}"
         data-scope="profile address email phone"
         data-state="{{ state }}"
         data-client-id="{{ client_id }}">
   </script>

The button is configured using data attributes . The required data-attributes are:

  • target : The OIDC redirect_uri , that users will be returned to with an authorization token from OneID.

  • scope : The OIDC scope parameter. Comma separated list of scopes see: Table of Supported Scopes

  • state : The OIDC state parameter. Should be a unique string to identify this session when the user returns.

  • client-id : The OIDC client_id parameter. This will be unique for each relying party client configured with the OneID platform.

OneID JavaScript URL

The OneID JavaScript can be loaded from the following URL: https://public-assets.myoneid.co.uk/latest/oneid.js

We recommend using the JS from here rather than vendoring to help keep the version of oneid.js in use up to date. If you do choose to self-host the javascript then plan for a way to keep it updated.

Sandbox Configuration

In order to use the OneID button in the Sandbox the OneIDBaseURL variable should be set in the following way:

    <script>
      window.OneIDBaseURL = "https://controller.sandbox.myoneid.co.uk";
    </script>
    <script src="https://public-assets.myoneid.co.uk/latest/oneid.js" id="oneid-button" ...>