New feature: Use OMNIA as your backend, and build your own frontend using the framework of your choice
Posted February 23rd, 2023
New feature: Use OMNIA as backend, and build your own frontend using the framework of your choice
Posted February 23rd, 2023
This new feature makes it possible for you to develop, using the framework of your choice, a web app that uses OMNIA both as its authentication provider and API (backend). This allows you to develop a completely customized frontend while utilizing all of your OMNIA backed functionalities (e.g. server-side entity behaviours).
Users can now authenticate themselves on your external app through the sign-in page of your OMNIA Platform. Additionally, this new feature includes the possibility for your app to consume the OMNIA API on behalf of the authenticated user.
How is this possible?
The OMNIA authentication service (i.e. Identity) acts as an Open Id Connect server. It is now possible to configure new Open Id Connect clients through the OMNIA Management UI.
Users that authenticate themselves through OMNIA on external apps also consent the external app to use the OMNIA API on their behalf. This is what enables external web apps to use OMNIA as their backend.
How to configure a new Web App client on the OMNIA Management UI?
When inside the OMNIA Management UI, access the API Clients page. Then click on Add New and choose WebApp:
Inside the modal, you need to specify your WebApp Client configuration. More details are available in OMNIA documentation:
After the new client is saved, a client ID is generated. You should copy and save this ID because you will need it to configure the OpenID Client of your Web App:
How to configure the Web App OpenID Client?
When configuring your Web App Open ID Client (we won’t go into detail in this blog post as it depends on the technology where the app is built), the following settings are required to use the OMNIA Authentication and API:
- Authority: Uri to your OMNIA subscription identity (e.g.: https://youromnia.yourdomain.com/identity)
- Response type: “id_token token”
- Claims: “openid email api”
Authentication process in action:
After the user clicks on the sign-in link on your app, he should be redirected to the OMNIA Sign in page as shown below:
When the user successfully authenticates himself on the OMNIA sign-in page, if the “require consent” option was checked in configuration, he will be presented with the following page:
After this process is completed, the user should be redirected to your external web app, and his OMNIA information (email and API Token) should be available to use.
We will soon write a blog article with an example of a web app, built using Blazor Webassembly, that authenticates its users using OMNIA and also consumes the OMNIA API on behalf of the users.
If you still don’t have this feature and want to start using it, remember to update your OMNIA platform to version 3.4.109, or above.
Platform Update and Documentation
This new feature is part of our 3.4.94 version of the platform.