Security for RPCs is handled through the RPC registration process. Each client application must create a context for itself, which checks if the application user has access to a "B"-type option in the Kernel menu system. Only RPCs assigned to that option can be run by the client application.
To enable your application to create a context for itself:
The OPTION TYPE "B" represents a Broker client/server type option.
Field Name | Entry | Description |
RPC (#.01) | Required | This field is used to enter a pointer to the REMOTE PROCEDURE file (#8994). This field links the remote procedure call in the REMOTE PROCEDURE file (#8994) to the package option. |
RPCKEY (#1) | Optional | This field is used to restrict the use of a remote procedure call to a particular package option. The RPCKEY field is a free-text pointer to the SECURITY KEY file (#19.1). |
RULES (#2) | Optional | This field is used to enter M code that is executed when an RPC request is made to verify whether the request should be honored. |
if not RPCBroker1.CreateContext(option_name) then Application.Terminate;
If the CreateContext method returns True, only those RPCs designated in the RPC multiple of your application option will be permitted to run.
If the CreateContext method returns False, you should terminate your application (if you don't your application will run, but you will get errors every time you try to access an RPC).
Bypassing RPC Security for Development
Having the XUPROGMODE security key allows you to bypass the Broker security checks. You can run any RPC without regard to application context (without having to use the CreateContext method). This is a convenience for when you are developing an application. When you complete development, make sure you test your application from an account without the XUPROGMODE key, to ensure that all RPCs needed are properly registered.