LEAP Auth Bearer Token TTL Reduction

The LEAP Auth Bearer Token (TTL) is being reduced to 15 minutes.

Reduced from 24 Hours for a Bearer Token generated using a Standard Client ID/Secret Pair and reduced from 30 Days for a Bearer Token generated using a Trusted Client ID/Secret Pair.

This change will mostly impact apps making use of the Implicit Code Flow, utilising Refresh Tokens & not using the SDK.

Please note that any App making use of the SDK will need to ensure that a fresh Bearer Token is retrieved from the SDK prior to calling an endpoint on the API Gateway.

Impact of Change

Apps using the Implicit Code Flow will be required to have conditions in place to check the expiry of a stored/existing bearer token and then to fetch a fresh bearer token should the stored token be expired or if it would expire during the next process of the app.

If an app has a process that may take a LEAP User more than 15 minutes to complete, it is recommended that there is a check in place prior to sending any requests to LEAP Endpoints.

The response from LEAP Auth when retrieving an Auth Token will contain an expiry date in the the response this will be the expires_in property contained in the response.

Sample Response:
{
    "access_token": "{{Auth_Token}}",
    "refresh_token": "{{Refresh_Token}}",
    "expires_in": 2592000,
    "token_type": "Bearer"
}

LEAP Auth Token Passthrough

LEAP Desktop will be removing the passthrough of the "authtoken" in the LEAP Context POST that happens for both Message Bus and the direct context POST sent to the target URLs for Apps.

This will impact all Apps that use the "authtoken" from the LEAP Context for either accessing the API Gateway or decoding the token to retrieve the details from the user (eg. the Firm ID, User ID and Staff ID) and are not making use of the LEAP Host SDK to retrieve these details.

Acquiring a Bearer Token for LEAP should now be done through either the Implicit Code Flow (making use of Refresh Tokens) or via the LEAP Host SDK.

Below outlines the standard format of the body previously provided in the LEAP Context Posts or via Message Bus. The Matter Context and other context provided below will continue to be sent, only the "authtoken" is being removed from the context provided.

Sample Body:
{
    "data": {
        "authtoken": "{{Auth_Token_Here}}",
        "matterContext": {
            "matterId": "{{Matter_ID_Here}}",
            "matterTypeId": "1",
            "tables": [
                {
                    "tableId": "",
                    "type": "",
                    "tableName": ""
                }
            ],
            "documents": []
        },
        "clientId": "{{Client_ID_Here}}",
        "isTrustedApp": false,
        "hostInfo": {
            "hostType": "desktop",
            "hostVersion": "2.3.135.0",
            "env": "live",
            "region": "au"
        }
    }
}

Note: The "authtoken" from the sample above is being removed.

Impact of Change

App Developers making use of the above "authtoken" field will be required to either:

  • Make use of the LEAP Host SDK in their application to retrieve the token and with version 3.0 of the LEAP Host SDK retrieve the decoded token context (Firm ID, User ID and Staff ID). This means Apps that do not have an SDK compatible front end will need to implement a javascript/typescript frontend page in order to use the SDK fetch context information for the user.
  • Alternatively, make use of the Implicit Code Flow should the App be operating as a Connector App. This allows apps to retrieve a Bearer Token for a use with the exchange of a Refresh Token once the LEAP User has been directed to a LEAP Auth login page and LEAP Auth has passed the user back to the original page.
Getting a Bearer Token via the LEAP Host SDK 2.0:
sdk.leapContext.authtoken
  // Returns the Access Token for the User.
Sample String:
"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjlkYTYwZmY0LTNjMzYtNDg5Zi05NGJlLWRjZjM2YzgwZDE2ZCJ9.eyJleHAiOjE2NzcxOTEzNDgsImZpcm1JZCI6ImJKM2ZiMTBmLWZjaDAtNDIwZi05MDViOTY2ZTJNOGZiYzM4OCIsImNvdW50cnlDb2RlIjowLCJ1c2VySWQiOiI2NTZmYzc0Ni1mZGIwLTQ5YTQtYmViMC1hZWEzOGU0MjYxMGYiLCJzdGFmZklkIjoiZnNkODIzYTMtNjZyMy00MmE4LXI2ODltYmE4OWZhMDA5ZjM2Iiwic2Vzc2lvbklkIjoialpvTHdyXzY5NGQ1NjI1LTU1N2QtNGYxYS1hZjlkLTFhZjAwYWJlODNmYiIsInNjb3BlIjoiKixvZmZsaW5lX2FjY2VzcyIsImJyYW5kIjoiTEVBUCIsInJlZ2lvbiI6ImF1IiwiZW52aXJvbm1lbnQiOiJ0ZXN0IiwidXNlclR5cGUiOiJMZWFwIiwicHJvdmlkZXIiOiJsZWFwLXVzZXIiLCJhcGlfcGVybXMiOlt7InIiOiIqIiwibSI6WyIqIl19XSwiYXVkIjoiQkVYV0pmRTZGTktOV1FJQSIsImlzcyI6ImF1dGgtdGVzdC5sZWFwLnNlcnZpY2VzIiwic3ViIjoiNjU2ZmM3NDYtZmRiMC00OWE0LWJlYjAtYWVhMzhlNDI2MTBmIiwianRpIjoicDRuak9kaXkzTTUyWk9vNiJ9.GileQ-TTNhIB48WC0Obzx6Op2qzTT6TkiOE7rWayuqMPX6HRzxscKnDSGQneJa-HRL9lS7zlHM-0bGCFRnXXYGCc2t4kGa-uflFygfPVTlK1w6ciwdq40-TmAF2_bUJV_w3nn-FX1jTB5Cs8TN-y1q6F-f5S2O4A8Ln09sbyW2g"

Important Note: The SDK will not return a refresh token, these must be retrieved by following the Implicit Code Flow.

Getting a Bearer Token via the LEAP Host SDK 3.0:

To obtain a bearer token via the LEAP Host SDK Vendors will need to do the following:

Initialise the SDK:

Passing in the LEAP Auth Client ID (for backwards compatibility this is still passed in for LEAP Host SDK 3.0.0. If the App is being used from LEAP Desktop 2.4, the passed in LEAP Auth Client ID here will be ignored (See Client ID Passthrough changes)).

sdk.init('LEAP Auth client ID').then(() => {
  // The LEAP Auth Client ID will only be used for LEAP Desktop 2.3
  // when used from LEAP Desktop 2.4 it will use the Client ID contained in the App Schema
   
  sdk.getRefreshedAccessToken()
  // Returns the Access Token for the User.
  
  sdk.getDecodedAccessToken()
  // Returns the decoded access token, instead of calling LEAP Context for Firm ID, User ID and Staff ID
  // firmid, userID, staffId are reterned here.

  }
 });
Sample String:
"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjlkYTYwZmY0LTNjMzYtNDg5Zi05NGJlLWRjZjM2YzgwZDE2ZCJ9.eyJleHAiOjE2NzcxOTEzNDgsImZpcm1JZCI6ImJKM2ZiMTBmLWZjaDAtNDIwZi05MDViOTY2ZTJNOGZiYzM4OCIsImNvdW50cnlDb2RlIjowLCJ1c2VySWQiOiI2NTZmYzc0Ni1mZGIwLTQ5YTQtYmViMC1hZWEzOGU0MjYxMGYiLCJzdGFmZklkIjoiZnNkODIzYTMtNjZyMy00MmE4LXI2ODltYmE4OWZhMDA5ZjM2Iiwic2Vzc2lvbklkIjoialpvTHdyXzY5NGQ1NjI1LTU1N2QtNGYxYS1hZjlkLTFhZjAwYWJlODNmYiIsInNjb3BlIjoiKixvZmZsaW5lX2FjY2VzcyIsImJyYW5kIjoiTEVBUCIsInJlZ2lvbiI6ImF1IiwiZW52aXJvbm1lbnQiOiJ0ZXN0IiwidXNlclR5cGUiOiJMZWFwIiwicHJvdmlkZXIiOiJsZWFwLXVzZXIiLCJhcGlfcGVybXMiOlt7InIiOiIqIiwibSI6WyIqIl19XSwiYXVkIjoiQkVYV0pmRTZGTktOV1FJQSIsImlzcyI6ImF1dGgtdGVzdC5sZWFwLnNlcnZpY2VzIiwic3ViIjoiNjU2ZmM3NDYtZmRiMC00OWE0LWJlYjAtYWVhMzhlNDI2MTBmIiwianRpIjoicDRuak9kaXkzTTUyWk9vNiJ9.GileQ-TTNhIB48WC0Obzx6Op2qzTT6TkiOE7rWayuqMPX6HRzxscKnDSGQneJa-HRL9lS7zlHM-0bGCFRnXXYGCc2t4kGa-uflFygfPVTlK1w6ciwdq40-TmAF2_bUJV_w3nn-FX1jTB5Cs8TN-y1q6F-f5S2O4A8Ln09sbyW2g"

Important Note: The SDK will not return a refresh token, these must be retrieved by following the Implicit Code Flow.

Client ID Passthrough

The LEAP Host SDK will no longer be accepting the Client ID as a passthrough in the Initialisation of the SDK and will use the Client ID belonging to the App itself provided in the App Schema File. This file will use the Client ID from the API Access - LIVE App Version section of the App in the Developer Console. This change is included in LEAP Host SDK v3.0 however, won’t be in use until LEAP Desktop version 2.4 has been released.

For Compatibility reasons the Client ID Passthrough is present and accepted in LEAP Host SDK v3.0 for use only with LEAP Desktop 2.3.xx.xx builds. Again, for LEAP Desktop 2.4 the Client ID for the API Access - LIVE App Version of the App will be used instead.

Impact of Change

Any Apps that are passing in a different Client ID to what is in the LEAP Developer Console for the App will have to update the permissions against the Client ID contained in the Security section of the Developer Console for the App. Including permissions that are required for the app to interact with the API Gateway and any redirect/allowed callback URLs for the App.

Updating the Apps permissions within the Developer console will also mean that when the App has the required permissions and Callback URLs added it will need to have a new version reviewed and pushed to Live.

Once the new App is live, existing App Users will be required to accept the new Policy for the App to make use of these permissions against the API Gateway. This is done through an automatic prompt the User will get in LEAP upon opening the App.

For Apps that are also using the Implicit Code Flow this may mean that users will need to re-authenticate against the new Client ID as any existing Refresh Token is tied to the older Client ID.

Testing and Developing Apps

App Developers will need to use the Sandbox Apps Client ID for test purposes. To ensure development and testing is not disrupted once this change has been implemented we recommend that you review the configuration of your LEAP Accounts in the LEAP Developer Console.

From the LEAP Accounts page, open the configuration for each Account and make sure that the Version of the App is set to Sandbox. This will set the App Schema for the LEAP Account to use the Sandbox Client ID for the App when opening it from LEAP.

Note: Test users for the LEAP Account will still be required to accept the changes to the policy for the app prior to being able to use that permission on the API Gateway.

Card & Person API Changes

We will be adding new endpoints to use for both Card & Person information that do not contain sensitive information.

This includes GET, PUT & PUSH. For security purposes, app Developers may be required to use the new endpoints for card/person information unless there is a specific requirement of the app to continue to utilise the endpoints that include sensitive information.

Please review the following fields and confirm if you are or are not using any of this information. Please email your response to marketplace@leap.build.

  • Bank Account Information (All)
    - BSB
    - Account Name
    - Account Number
    - Verified By
    - Date Verified
  • Beneficiaries
    - DOB
  • Person Information:
    - Date of Birth
    - Birth Place
    - Country of Birth
    - Death Place
    - Date of Death
    - Passport Number
    - Passport Name
    - Maiden Name
    - Pervious Name
    - Special Needs
    - Marital Status
    - Custom Fields (1-12)
    - Comments
    - Gender
    - Nationality

Below is an included breakdown of data excluded from the Response Body & Request Body by endpoint:

Endpoints

GET /api/v1/standard/cards/{cardId}

GET /api/v1/standard/cards

POST /api/v1/standard/cards

PUT /api/v1/standard/cards

GET /api/v1/standard/matters/{matterId}/cards

POST /api/v1/standard/matters/{matterId}/cards

PUT /api/v1/standard/matters/{matterId}/cards

Information Excluded from Standard Version
  • Bank Account Information (All)
    - BSB
    - Account Name
    - Account Number
    - Verified By
    - Date Verified
  • Beneficiaries
    - DOB


Endpoints

GET /api/v1/standard/cards/packages/{cardId}

GET /api/v1/standard/matters/packages/{matterId}

Information Excluded from Standard Version
  • Bank Account Information (All)
    - BSB
    - Account Name
    - Account Number
    - Verified By
    - Date Verified
  • Person Information:
    - Date of Birth
    - Birth Place
    - Country of Birth
    - Death Place
    - Date of Death
    - Passport Number
    - Passport Name
    - Maiden Name
    - Pervious Name
    - Special Needs
    - Marital Status
    - Custom Fields (1-12)
    - Comments
    - Gender
    - Nationality
  • Beneficiaries
    - DOB

Endpoints

GET /api/v1/standard/persons/{personId}

POST /api/v1/standard/persons

PUT /api/v1/standard/persons

GET /api/v1/standard/cards/{cardId}/persons

Information Excluded from Standard Version
  • Person Information:
    - Date of Birth
    - Birth Place
    - Country of Birth
    - Death Place
    - Date of Death
    - Passport Number
    - Passport Name
    - Maiden Name
    - Pervious Name
    - Special Needs
    - Marital Status
    - Custom Fields (1-12)
    - Comments
    - Gender
    - Nationality

Endpoints

GET /api/v1/standard/persons

Information Excluded from Standard Version
  • Person Information:
    - Previous Name
    - Date of Birth
    - Drivers License

For further information please refer to the API Reference or contact LEAP Dev here.

LEAP APILEAP Host SDK