Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

templates-secret

Summary

Template / Example for a microservice using tenant options to store a secret encrypted on the Cumulocity platform.

Cumulocity tenant options: https://cumulocity.com/guides/reference/tenants/#option

Use case

Often used for cloud 2 cloud integration when credentials of other API must be stored encrypted at Cumulocity.

How to run locally:

  1. Build project

mvn clean install

  1. Create application at cumulocity

POST 'https://{base-url}/application/applications'

Request body:

{
  "key": "templates-secret",
  "name": "templates-secret",
  "contextPath": "templates-secret",
  "type": "MICROSERVICE",
  "manifest":{},	
	"requiredRoles": [
        "ROLE_OPTION_MANAGEMENT_READ",
        "ROLE_OPTION_MANAGEMENT_ADMIN"
	],
	"roles": [
	]
}
  1. Subscribe application to your tenant via UI

  2. Acquire microservice bootstrap credentials

GET 'https://{base-url}/application/applications/{applicationId}/bootstrapUser

Response body:

{
    "password": "************************",
    "name": "servicebootstrap_templates-secret",
    "tenant": "<your tenant>"
}
  1. Add bootstrap credentials

to your src/main/resources/application-dev.properties

  1. Start microservice with spring profile "dev"

java -Dspring.profiles.active=dev -jar cumulocity-microservice-templates-secret-0.0.1-SNAPSHOT.jar

Disclaimer

These tools are provided as-is and without warranty or support. They do not constitute part of the Software AG product suite. Users are free to use, fork and modify them, subject to the license agreement. While Software AG welcomes contributions, we cannot guarantee to include every contribution in the master project.

Contact

For more information you can Ask a Question in the TECHcommunity Forums.

You can find additional information in the Software AG TECHcommunity.


Contact us at TECHcommunity if you have any questions.