Quick-Migration Guide (v2 -> v3)

Introduction

When you already have a V2 integrated this page will provide you with some easy steps to quickly migrate to the V3 of the Trust1Connector. Migration from the v2 to the v3 of the Trust1Connector can be done in 2 ways;
    1.
    Integration of the API
    2.
    Integration via the deprecated Javascript SDK
Both are viable integrations. When integrating via the API you have more control over the functionality and the dependencies used.

Update a v2 application to v3

For updating your web application first of all you need to use the new Javascript SDK. After this there are some differences in using the SDK from the v2.

Configuration

The configuration from the v2 has changed, we simplified this.
The v2 had the following configuration options;
1
export class GCLConfigOptions {
2
constructor(public gclUrl?: string,
3
public gwOrProxyUrl?: string,
4
public apiKey?: string,
5
public gwJwt?: string,
6
public tokenExchangeContextPath?: string,
7
public ocvContextPath?: string,
8
public dsContextPath?: string,
9
public dsFileContextPath?: string,
10
public pkcs11Config?: Pkcs11ModuleConfig,
11
public agentPort?: number,
12
public implicitDownload?: boolean,
13
public forceHardwarePinpad?: boolean,
14
public sessionTimeout?: number,
15
public consentDuration?: number,
16
public consentTimeout?: number,
17
public syncManaged?: boolean,
18
public osPinDialog?: boolean,
19
public containerDownloadTimeout?: number,
20
public localTestMode?: boolean,
21
public lang?: string,
22
public providedContainers?: T1CContainerid[]) {
23
}
24
}
Copied!
With the v3 this is significantly simplified to the following;
1
class T1CConfigOptions {
2
constructor(
3
public t1cApiUrl?: string,
4
public t1cApiPort?: string,
5
public t1cProxyUrl?: string, // deprecated
6
public t1cProxyPort?: string, // deprecated
7
public jwt?: string,
8
public applicationDomain?: string, // "rmc.t1t.be"
9
) {}
10
}
Copied!
Some of the config options of the v3 are still in review and can be removed up until the final release of the v3, in the table below you will find more information
V2 config option
V3 config option
Description
gclUrl / gwOrProxyUrl
t1cApiUrl
in the V2 this was https://localhost:10443 while in the V3 this will be https://t1c.t1t.io (for T1T)
t1cApiPort
is the port where the webserver is listening on, in the v2 this is 10443 but in the v3 by default(T1T) this is 51983
t1cProxyPort
This value represents the port where the Proxy webserver is listening on. By default this is 51983 (obsolete)
t1cProxyUrl
Similar to the api url this is the URL where the proxy used in shared environment is running on. This is by default the same as the API url (obsolete)
applicationDomain
Host of the web application the Trust1Connector is being used on. This property is used to make sure no Consent collisions can happen
apiKey
/
gwJwt
jwt
JWT token used for authentication of the web application towards the Trust1Connector. This must be retrieved from the web applications backend
tokenExchangeContextPath
/
ocvContextPath
/
dsContextPath
/
in v2 this was the context path for the DS based on the gwOrProxyUrl
dsFileContextPath
/
pkcs11Config
/
agentPort
/
implicitDownload
/
forceHardwarePinpad
/
sessionTimeout
/
consentDuration
/
syncManaged
/
osPinDialog
/
boolean which depicts the default os pin dialog value
containerDownloadTimeout
/
localTestMode
/
lang
/
providedContainers
/

Initialisation

After you've created your configuration object you can do the initialisation of the Trust1Connector SDK. This has largely remained the same except for the error codes.
V2 example:
1
config = new GCLLib.GCLConfig(configoptions);
2
GCLLib.GCLClient.initialize(config).then(res => {
3
client = res;
4
core = client.core();
5
console.log("GCLClient: ", res)
6
}, err => {
7
console.log("GCL error:", err)
8
})
Copied!
V3 example;
1
config = new T1CSdk.T1CConfig(configoptions);
2
T1CSdk.T1CClient.initialize(config).then(res => {
3
client = res;
4
console.log("Client config: ", client.localConfig)
5
core = client.core();
6
7
}, err => {
8
errorHandler(err);
9
});
Copied!
For more information regarding initialization we suggest the Initialize page
Last modified 14d ago