Custom JWT Tokens |
Scroll |
Use Case:
The customer already has an authentication infrastructure or wants the Thereforeā¢ Portal to be integrated with their own portal. If a user is already authenticated in the customer portal, it should not be required to authenticate again for Thereforeā¢, hence having a SSO experience in between different applications. The customer portal application can then create such a custom token and use this to automatically log the user into Thereforeā¢ with the provided user account. No additional login required.
1.Configuration in the Therefore Solution Designer The following information needs to be populated in the respective fields:
Issuer Id: must match the Issuer Id in the jwt token sent to Thereforeā¢. Name: Any name can be given to the UI (only). Active: Enable or Disable a customer issuer. Secret/Certificate: Define a shared key or upload a .cer file for validation of the token.
2.Custom JWT Token Payload:
{ Ā "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name": "Test AD", Ā "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress": "testad@therefore.net", Ā "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname": "ADOS\\testad", Ā "aud": "<CustomerId>", Ā "nbf": 1547106872, Ā "exp": 1547108072, Ā "urn:oauth:scope": "therefore_user" Ā "iss": https://testissuer.therefore.net } Ā aud = CustomerId of the Therefore System iss = Issuer Id ā must match Therefore Configuration urn:oauth:scope = scope of the token - values "therefore_user" (all user permissions) or "therefore_read" (read only)
3.Custom JWT Tokens can be used to authenticate users of Thereforeā¢ in Web Client, Portal, API, WebAPI.
Example (Web Client): https://<server>/TWA/Client/Web/Viewer/Viewer.aspx?docno=349738&ssoToken=<token> https://<server>/TWA/Portal/Portal.aspx?qNo=123&ssoToken=<token>
Example API: string sToken = "<token>; string sNodeInternal, sNodeFriendly; TheServer s = new TheServer(); s.ConnectBearerToken(TheClientType.CustomApplication, sToken, "", "", "", true, TheConnectMode.NoLicenseMove, out sNodeInternal, out sNodeFriendly);
4.Special permissions can be defined for a token. Reference: Permissions for JWT tokens.
Test Walkthrough:
1.Create Test Tokens here: https://jwtbuilder.jamiekurtz.com/ 2.Configure the issuer in Thereforeā¢ Solution Designer. 3.Use the token with any access option described above (Web Client, Portal, API, Web API).
|
---|