Third Party API’s Mendix Integration

Third-Party-API’s-Mendix-Integration

API generally stands for Application Program Interface. It creates a bridge / medium for two different software programs / units.

2 What is Third Party API’s?

Let’s say that the business leaders are planning for increasing the efficiency and proficiency of their business in terms of growth. So they would create the set of processes or software programs (Server) which then it provides the service to their clients (Client) with the help of API.

Producer:-     An Entity who produces the API’s to serve their clients.

Consumer:-     An Entity who consumes the produced API’s from their Service Provider.

3 Advantages of Thrid Party API integration in Mendix:

It takes more time and cost while Integrating third-party API’s in Traditional Application. For Instance, Implementing SSO Single Sign-On Mechanism in traditional app development ( Angular / React as a client-side scripting with NodeJS / Java / Ruby as a server-side scripting ).

In general, to implement SSO, we need to create an application in IdP – Identity Protocol ( Like Okta, Lastpass, OpenIDConnect, Keycloak ). To implement SSO in the traditional application, it would hardly take 6 – 8 hours, since we need to configure those IdP credentials in SP’s – Serivice Provider’s with the help of SAML Module.

SAML stands for Security Assertion Markup Language is an open standard for exchanging authentication and authorization data between parties, in particular, between an identity provider and a service provider.

Whereas in mendix, implementing an SSO Mechanism is a low-code platform, so by integrating MxModelReflection, SAML Mendix App Store modules and Mendix defaults actions and java actions. By making use of SAML Module we would be easily able to configure the IdP details.

product development

4 Processes and Challenges while implementing OKTA Third-party  API in Mendix:

  1. Scalability of Mendix application always rely on the service team and quite frustrating to get in touch with the Mendix providers
  2. Frequency of updating the modelers
  3. One needs to get always touch with the technology in order to standardize your collaboration with the API

Let’s see the sample Mendix – SSO Application creation with the help of OKTA Third party API.

Required Modules:

  1. Mx Model Reflection
  2. SAML 2.0
  3. Okta account https://www.okta.com/

SSO Process flow diagram:

Mendix flow diagram

Mx Model Reflection setup

  1. Create a mendix application.
  2. Add “Mx Model Reflection” from mendix app store

(Note: Mx model reflection is necessary for SAML to operate)

SAML Module setup:

  1. Add Mx model reflection module.
  2. Add “SAML 2.0” module from app store.
  3. At this point 2 errors will be displayed.
  4. Click on the first error and go to the page -> right click -> properties -> master layout -> Change to (Model pop Layout).
  5. Drag the “Main” to the Main sector and delete the content header.
  6. Goto Navigation -> new item -> On click -> Call a micro flow ( select the micro flow SAML20 / _USE ME  / Examples / Open configuration) this is where the saml can be configured.

SAML Configuration at Runtime:

  1. Run the application
  2. From the navigation select   “Open Configuration” tab
  3. Click “SP Configuration” tab and  Enter the details as per the Organization information. Eg: Organization Url: http:localhost:8080/
  4. Copy the Entity id .
  5. Click Save button to save the details.

Okta – App creation:

  1. Sign in to okta.com as developer.
  2. Go to Admin section   -> Click “Applications” tab
  3. Click Add Applications – > Create new Application -> Select   SAML 2.0 application
  4. Provide an application name and logo
  5. In SAML settings Provide the following details
    1. Single sign on url: Organization Url.
    2. Audience URI (SP Entity ID) :  Paste the Entity id copied from SAML Configuration.
    3. Provide the attribute details as

FirstName and select user.firstName from drop down.

LastName and select user.lastName from drop down.

Email and select user.email from drop down.

  1. Click the radio “I’m an Okta Customer adding an integrated app
  2. Select APP type as “This is an Internal app that we have created “
  3. Click finish to save the details.

Settings:

  1. Now, the new page would be opened which would have four tabs such General, Sign on, Import and Assignments.
  2. Under Sign on tab, there would be a link for identity provider metadata and copy the url.
  3. Click Assignments tab, select people from assign dropdown.
  4. Click assign and save, then go back.
  5. Click done.
  6. Example of Identity Provider Metadata URL

https://dev-804898.oktapreview.com/app/exkh2rs4qvdWFSItr0h7/sso/saml/metadata

IdP Configuration:

  1. Run the Mendix application
  2. Click Open Configuration
  3. Click new in IdP Configuration
  4.  Click ok for the information pop up displayed and click next button.
  5.  Enter any name as alias name
  6.  Paste the metadata URL in the textbox click next
  7. Check “Allow Idp Initiated Authentication and click next
  8. Leave the IdP attributes as “IdP Provided ” and click next
  9.   No need to select anything click next
  10. Click Submit.
  11. Select the IdP and press “toggle active” tab.

That’s it. Here we go, save and run the application.

and check the url : http://localhost:8080/sso/

It just takes hardly 45 minutes to 1 hour, and it saves around 5 – 7 hours approximately when comparing to traditional app development. That’s the beauty and impact of Mendix.

5 Conclusion

This blog post covers implementing 3rd Party API’s Mendix Integration. This offer’s a number of unique advantages over more traditional development. Furthermore, we have demonstrated that Mendix application deployments could be much simpler than ever expected

Leave a Reply

Your email address will not be published. Required fields are marked *

Shares