cancel
Showing results for 
Search instead for 
Did you mean: 

Best Practice when it comes to storing credentials

YanGerzon
Participant
0 Kudos

Hello,

I'm currently working on a Spring project that's deployed in a SAP BTP subaccount space. In the BTP cockpit, I've set up environment variables to store credentials, and this configuration works well when the project is deployed.

However, I encounter an issue during the development phase. When I run the application locally in the Business Application Studio for testing, I'm unable to access these environment variables defined in the BTP subaccount.

I'm seeking advice on the best practice for managing these variables. Specifically, I need a solution that allows me to:

  1. 1)Use these variables locally while running the app in the Business Application Studio.
  2. 2)Ensure that these variables are accessible when the app is deployed in BTP.
  3. 3)Store these variables in a way that they are not included in the version control repository.
  4. 4)Maintain easy accessibility of these credentials in the code for local testing and deployment scenarios.

Any guidance on how to effectively manage these environment variables in both local and deployed environments would be greatly appreciated.

Thanks in advance.

Dinu
Contributor
0 Kudos

Is this an application using CAP?

Accepted Solutions (0)

Answers (1)

Answers (1)

yogananda
Product and Topic Expert
Product and Topic Expert

101ger

I would suggest BTP Destination is the right choice to store your credentials and to test your application locally in VS Code and BAS as well.

Also there is Service in BTP which is Credential store which can also store the credentials but for testing it locally… I don't think it's possible to test in Hybrid mode but you can bind the app after deploying to BTP..

YanGerzon
Participant
0 Kudos

Thanks for the reply.

The connection is made to an SFTP server and as far as I understand that is not supported by the destinations setup in the BTP.
In general though, how do you use a detination when testing the app in BAS when its not deployed?

gregorw
Active Contributor
0 Kudos

Hi Yan,

if you develop your spring project with CAP Java you could use Hybrid Testing. But that should be also possible with a pure spring project when you provide the environment variable VCAP_SERVICES with the connection data to the Destination Service. To gather a better understanding of the destination service I would suggest you try my REST Client Script destination.http. You could use the destination service as an easy to use option beside Credential Store that Yogananda suggested. Just get the values from it and use it then in your own implementation for the SFTP connection.

Best Regards
Gregor