If you do not want specific applications to call your microservice application, you can configure rules to authenticate applications. Only the applications that match the authentication rules are allowed to call your application.
Background information
The following example shows how to use service authentication in Dubbo.
Consumers 1, 2, and 3 and the provider belong to the same namespace. By default, Consumers 1, 2, and 3 can call all the services and interfaces of the provider.
You can configure an authentication rule for all the services and interfaces of the provider. For example, you can configure a blacklist for Consumer 1 to prevent it from calling the services and interfaces of the provider, and configure a whitelist for Consumers 2 and 3 to allow them to call the services and interfaces of the provider.
You can also configure an authentication rule for a specific service and interface of the provider. For example, you can configure a blacklist for Consumer 2 to prevent it from calling Service 2 and Interface 2 of the provider because they involve core business or data. Then, Consumer 2 can call only Services and Interfaces 1 and 3 of the provider.
The following figure shows the call process with authentication rules configured.
Create a service authentication rule
Verify the result
After the service authentication rule is created and enabled, check whether the rule takes effect.