Steps for Integrating Identity using OIDC
This chapter describes generic steps to integrate an identity provider with the Trillo Workbench using OIDC authorization code.
Trillo Workbench supports seamless integration with external IdPs like Okta, OneLogin, and Google, using the industry-standard OpenID Connect (OIDC) authorization code flow. This guide outlines the straightforward 3-step process to enable this integration, empowering you to leverage your existing identity systems for Trillo Workbench logins.
Enter IdP settings into Trillo Workbench using UI.
Map user profile returned by IdP onto Trillo Workbench user schema.
Start using it for login through Trillo Workbench.
Enter IdP settings into Trillo Workbench using UI
When you register with an IdP, you will receive a number of parameters that need to be used in the application (i.e. Trillo Workbench as your application platform). These parameters are listed in the table below.
When you add an IdP to the Trillo Workbench you create a record with the following information.
Name - some user friendly name for reference.
Service Name - a service name that is used in the API by the client (UI).
Grant type, it is set as Authorization Code.
IdP and Trillo Workbench related parameters listed in the following table.
Authorization URL
Issued by IdP. It is URL where user is redirected to login with redirect url, state etc parameters.
Token URL
Issued by IdP. It is used by Trillo Workbench to obtain Access Token.
Client Id
Issued by IdP.
Client Secret
Issued by IdP.
Redirect URL
It is standard Trillo Workbench callback URL. Use your Trillo Workbench instance url.
<Trillo WB Server>//_oauth2/callback
Comma Separate List of Scopes
Issued by IdP.
openid, email, profile
User Profile Info URL
Issued by IdP. It is used to obtain user profile (email, name, phone, etc. as permitted by the scope).
User Info Transformation Function
This is discussed more in detail below. This is a simple code that maps user profile returned by IdP to Trillo Workbench user schema.
GoogleUserProfileMapper
Post Authentication URL
URL where user should land after successful login.
UI URL where user is supposed to land post successful login
Logout URL
Issued by IdP. It is used to logout the use from IdP when user logs out of the application.
Map user profile returned by IdP onto Trillo Workbench user schema
Trillo Workbench aligns user profiles received from your IdP with its own user schema, ensuring effortless data synchronization. The intuitive nature of this mapping is clearly illustrated in the following example.
In order to make this code available to the Trillo Workbench, simply add the above function to the Trillo Workbench. (For convenience, the above function is added to the Trillo Workbench and you can view it by turning on Show system function.
Start using it for login through Trillo Workbench
Once you follow the above steps are completed, you can integrate external IdP with the login button using the following steps.
Add a Button: Add button with a label such a Login Using Google Identity.
Fetch IdP Url and point the browse to it: When user clicks on the login button the following actions should take place.
Use /_oauth2/url endpoint to get a url with a new "state" parameter (generated and recorded by the Trillo Workbench).
Point browser to the URL returned by the above call. This will take the user to IdP UI, which will present a login dialog to the user.
Once user logs in successfully, the browser will be redirected to the Trillo Workbench UI with a code. The code will be used by the Trillo Workbench to fetch the access token using the token endpoint. This will happen behind the scene and you don't have to do anything for it.
Sample code for the above interaction is as follows:
Endpoint:
Headers:
Body:
Response:
After obtaining access token, Trillo Workbench redirect the browser to "Post Authentication URL", which is a UI URL. This URL will have a query parameter called a_t_nonce. Using the value of this URL, the UI will invoke a API (/_oauth2/nonceLogin) of Trillo Workbench to get the access token recently acquired by the Trillo Workbench.
Endpoint:
Headers:
Query Parameters: none
Response:
Once the UI receives recently generated access token and the user's profile, it is logged in. It can use access token in other API calls.
Last updated