Karias Bolster
Karias Bolster

Reputation: 1035

Secure Way To Store Credentials in Front-End Tests

I am currently writing automated tests using webdriverio for my current project. The thing is the company Im currently working is so strict with security so putting the credentials in the spec file is a big no. This project we are working is an internal tool and the authentication is using the employees' gmail accounts which is also the authentication being used across all services being used by the company. Can someone suggest other ways how to store credentials securely that my spec file can access. Thanks.

Upvotes: 3

Views: 2142

Answers (1)

Kevin Lamping
Kevin Lamping

Reputation: 2269

I just posted a video about this on YouTube. Granted, it's about storing Cloud Selenium Service credentials, but the same ideas apply.

Here are the three options I cover:

  • Pass in credentials via the command line
  • Store the credentials in a 'secrets.js' file that isn't part of your shared code and load it via Node's require system
  • Store the credentials in environment variables and use process.env to access them.

Upvotes: 6

Related Questions