Create JWT Token Authentication from Okta and Implementation
Introduction
What is meant by the JWT token?
JWT stands for JSON Web token is a proposed internet standard for creating data with optional signature and optional encryption whose payload holds JSON that asserts some number of claims.
Creation of OKTA Account
Step 01: In this use case will create an OKTA ID and implement a token by using this link https://developer.okta.com/login/
Step 02: Followed by continue with Google Account by adding username and password, then present to the OKTA Home page.
Step 03: Now in the Dashboard we have an option called APPLICATIONS drop-down button then we have an option called APPLICATIONS and then go with CREATE APP INTEGRATION
Step 04: Then select OIDC – OPENID CONNECT in sign-in method and select WEB APPLICATION in Application type then select NEXT
Step 05: New Web Application Integration tab opens. Here, we need to give the Application Integration Name: JWT_PRACTICE, for Grant type select the Client Credentials check box.
Step 06: Then next is Sign-in redirect URI and Add URI from Gateway => Location Settings => Copy the Public URL
Step 07: and paste it in the Add URI box.
Step 08: Then at the bottom of the page we have option called ASSIGNMENTS, Select the check box as Allow everyone in your organization to access
And then SAVE.
Step 09: By selecting on SAVE we get a pop-up as Application Successfully Completed and then Client ID and Client Secret will be generated.
Now,
In boomi we are creating a new process.
Step 10: Create a new process with start shape as Connector type Web Service Server and Action as Listen
Step 11: and in operation select operation type as GET and object as jwt which will be added to the URL
=> As we are selecting as GET we don’t need to give a request profile.
=> and our output is in XML format then we will need to give the XML profile and then SAVE.
Step 12: and in message shape we are passing the data followed by Return document shape.
Step 13: Then we will Create package Component and Deploy the process.
Step 14: Lets create a API Service Component.
In the process canvas page From the Create New option, we can select API Service Component.
Step 15: Now, it shows a API Service Component home page were we need to add Published API title => Published version Number => Base API Path
Step 16: Then go to REST tab and select import an Endpoint by using existing process
Step 17: and add the REST API and select the Existing process.
Then it will look like by adding the endpoint
Step 18: Now, create a package component and Deploy it to the Environment which is attached to the Gateway.
Step 19: Boomi will offer multiple services, in that we have one service known as API Management
Step 20: Then it goes to the API Management home page there we have option called CONFIGURE SERVER in that we have option called GATEWAYS
Step 21: Here we need to Add a Gateway and then setup a Gateway by selecting an Operating System and in Security options we need to copy a Gateway Installer Token and then select Download Installer.
Step 22: Now, go to Download list where the Gateway is downloaded and then right-click the Installer and select RUN as Administrator
Step 23: Then select Run Anyway => then select as Next => Then in the user information select as Token and give the Gateway Name and the token which we have copied earlier for installation.
Step 24: Then select Next and Next to download the JRE files and wait for Finishing to install the Gateway on our local machine.
Step 25: Gateway has been installed, now we need to migrate this to Environment migration by selecting the tab.
Step 26: Now, we need to attach an Environment to the Gateway and then Create migration => now, select the Gateway which we have installed
Step 27: Then select Save and Continue and check the endpoints and select Save and Continue, it will be confirming the status and we need to check again and select Save and Continue. Then at the end we will finish the process and get a pop-up as Gateway Installed Successfully.
Step 28: After creating a Gateway we need to create an Application which is under the Configure APIs and Applications tab.
Step 29: Now Create an Application by selecting the Gateway Name, Application Name, Application Owner Name, Application owner Email and then SAVE.
Step 30: Now, Create Plan for the Application in Configure Server tab
Step 31: After selecting a Plan now configure a Plan by giving the proper name of the Plan and also the message size, Rate limit, Quota limit to the Plan.
Step32: After creating a Plan go to Authentication from Configure Server tab
Step 33: and configure a New Authentication Source by giving Authentication Source Name, Description and Identity Provider Type.
In Identity Provider Type we have two options i.e, Basic Authentication (Gateway) and JWT Authentication. Here we go with JWT Authentication.
Step 34: After Selecting an Identity Provider Type as JWT Authentication we need to add an Identity Provider URL which is required. This Identity Provider URL need to take below from OKTA user name i.e, dev-82304554.okta.com
Step 35: Prepend this OKTA ID with https:// and Append with /oauth2/default.
At the end, it will be in the form of https://dev-82304554.okta.com/oauth2/default
Step 36: After Authentication we need to Configure APIs and Applications with the Deployed APIs and check with the Authentication method. Here we can check that the process which we have configured and created API Service Component will be reflecting in this Deployed APIs
Step 37: then need to add previously created Plan for the Gateway.
and then SAVE it.
Step 38: After selecting a Plan for the Deployed process. Then view the process
Step 39: then a new tab appears were we go to Rest tab
Step 40: In the new tab copy the Endpoint path. Now go to Postman for checking the API.
Step 41: Add a new request from the Postman and paste the same URL which we have copied from the Deployed API
Step 42: In Authorization select type as Oauth 2.0 and Add authorization data to the Request Header
In the new tab copy the Endpoint path. Now go to Postman to check the API.
Step 43: Now we need to Configure New Token by selecting Grant type as Authorization Code => Call back URL as http://localhost:8077
Step 44: Auth URL as same as Identity Provider URL followed by /v1/authorize i.e, https://dev- 35000642.okta.com/oauth2/default/v1/authorize
Step 45: Access URL token as same as Identity Provider URL followed by /v1/token i.e, https://dev-35000642.okta.com/oauth2/default/v1/token
Step 46: Copy Client ID and Client Secret from OKTA and paste in postman
Step 47: Scope as OpenID and State as ‘a’
Step 48: Then we need to Hit the button as Get New Access token
Step 49: Then use Token
Step 50: and at last, Hit the URL and will get the response.