Configuring Public Key Authentication
Public key authentication is a simple and efficient authentication mechanism between microservices provided by CSE. Its security is based on the reliable interaction between microservices and the service center. That is, the authentication mechanism must be enabled between microservices and the service center. The procedure is as follows:
- When a microservice starts, a key pair is generated and the public key is registered with the service center.
- Before accessing the provider, the consumer uses its own private key to sign a message.
- The provider obtains the public key of the consumer from the service center and verifies the signed message.
To enable public key authentication, perform the following steps:
- Enable public key authentication for both the consumer and provider.
servicecomb: handler: chain: Consumer: default: auth-consumer Provider: default: auth-provider
- Add the following dependency to the pom.xml file:
<dependency> <groupId>org.apache.servicecomb</groupId> <artifactId>handler-publickey-auth</artifactId> </dependency>
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot