Setting up JWT authentication for developer toolkit
Use the information in the section to set up JWT authentication for IBM® Sterling™ Order Management System Software Order Service in Sterling Order Management System Software developer toolkit. By default, authentication is disabled in Order Service in Sterling Order Management System Software developer toolkit.
All incoming requests in Order Service are authenticated with the help of signed JWT (JWS). To authenticate the incoming request, Order Service uses JWT token that is generated by Sterling Order Management System Software.
- For Sterling Order Management System Software
- Enable Order Service authentication in Sterling Order Management System Software by
setting property
osi.orderservice.auth.disabledtofalse. - Configure JWT properties for Sterling Order Management System Software. For more information, see JWT properties for Sterling Order Management System Software.
- Generate keystore in Sterling Order Management System Software. For more information, see Generating keystore in Sterling Order Management System Software.
- For Order Service
- Enable JWT authentication in Order Service by setting the
service_auth_disableas false inorderservice.propertiesfile in developer toolkit environment under compose-orderservice/docker/configuration. - Configure JWT properties for Order Service. For more information, see JWT properties for Order Service.
- In a command-line utility, go to the
compose-orderservicedirectory of your developer toolkit environment. Runorderservice-compose.shsetup-upg target to update the changes in the order service docker container.
Generating keystore in Sterling Order Management System Software
To create keystore that has PRIVATEKEY and PUBLICKEY pair, complete the following steps.
- Create a keystore by running the following command from inside the
devtoolkit_docker/jndidirectory.keytool -genkey -keyalg RSA -keysize 2048 -keystore <keystore_name> -validity 365 -storetype JKS -alias <alias_name> -storepass <password> -keypass <password> -dname "CN=oms, OU=oms, O=oms, L=oms, S=oms, C=US"-
-keystoreprovides the keystore name, for example,key.jks -
-aliasdescribes the alias name that is configured as part of JWT properties of Sterling Order Management System Software. For more information, see JWT properties for Sterling Order Management System Software. -
-storepassand-keypassprovides the password for your keystore.
-
- Verify that the private key is created by running the following
command.
keytool -list -storetype JKS -keystore <keystore_name> -storepass <password> - Export the public key by running the following
command.
keytool -export -alias <alias name> -keystore <keystore_name> | openssl x509 -inform der -pubkey -noout - Update the following
jvm.optionscontained within the application server container.docker exec -it om-appserver bash- Update
/config/jvm.optionsfile with the following arguments.-Dycp.jwt.auth.keyStore=<location to devtoolkit_docker/jndi directory>/<keystore file name>-Dycp.jwt.auth.keyStorePassword=<password configured while creating the keystore>
- Use the following command for running
agents.
./agentserver.sh -jvmargs "-Dycp.jwt.auth.keyStore=<location to devtoolkit_docker>/<keystore file name> -Dycp.jwt.auth.keyStorePassword=<password configured while creating the keystore>" <servername>