Using AK/SK Authentication
Concept
The professional microservice engine requires AK/SK authentication. This topic describes how to configure AK/SK.
Example Configuration
AK/SK authentication depends on the AK/SK configured by users. ServiceComb provides plaintext configuration by default and allows users to customize the encryption storage scheme. The customized encryption storage requires version 2.1.3 or later.
- Add the following configuration in plaintext to the microservice.yaml file:
servicecomb: credentials: accessKey: yourak secretKey: yoursk project: yourprojectname akskCustomCipher: default - Implement API org.apache.servicecomb.foundation.auth.Cipher, which contains two methods:
- String name()
Name definition of servicecomb.credentials.akskCustomCipher, which needs to be added to the configuration file.
- char[] decode(char[] encrypted)
Decrypt the API, which is used after secretKey is decrypted.
The implementation class must be declared as Bean. For example:
@Component public class MyCipher implements Cipher
Add the following configuration to the microservice.yaml file:
servicecomb: credentials: accessKey: yourak secretKey: yoursk #SK information in ciphertext. project: yourprojectname akskCustomCipher: youciphername #returned name of the name() method in the added class. - String name()
Last Article: Accessing Applications to a Microservice Engine
Next Article: Using RBAC Authentication
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.