Enabling SSO for IBD REST

To enable Single Sign-On (SSO) for EGL REST services, create an EGL REST service project and configure the required properties at the build descriptor level.

Below are the options that need to be configured for SSO:
  • KeycloakJwksUri : This needs to be the Keycloak Jwks_uri, which you will find in Configuring Keycloak.
Once the configuration is complete, you can write APIs/services, generate them, and deploy them. The section below provides a sample code base.
Note:
  • To create a Public API that isn’t secure, make sure that the service name is public (refer below for sample code).
  • To secure a particular service, make sure that you add {secured = true} at the service level.

Sample Code:

Below are the steps to configure Keycloak.

  1. Public/Unsecured Service:
    package pkg;
    // service
    service service2
          // Variable Declarations
          variableName string;
          // Function Declarations
          function functionName() returns (string)
                return ("welcome from public service2");
          end
    end
  2. Secure/Protected Service:
    package pkg;
    // service
    service service1{secured = true}
          function functionName() returns (string)
                return ("welcome from secured service1");
          end
    end
    
Note:
All the services that are annotated with secured = true, their service endpoint will be changed/added as below:
  • For service1: it will be modified as this is a secured service, like below

    http://{host}/{context}/restservices/secured/service1

  • For service2: it will be as usual, like below

    http://{host}/{context}/restservices /service2