Token and Environment Configuration

Onboarding Credentials

If you have not received your onboarding credentials yet, ask the onboarding team for them.

The username and authorization token values provided by the onboarding team will give you access to pull down code from the VA code repository, push code changes via feature branches, and pull dependencies from the VA Nexus and Sandbox DTR repositories. This will allow you to start working stories while waiting on full access.

Authorization tokens have expiration dates that are configurable; when you receive these tokens, ask when they expire and add an entry on your personal Apothesource calendar to remind you that these tokens will need to be replaced with your own permanent tokens once you have complete access.

Environment Variable Configuration

Ensure that you also have set the Skaffold RPC Port in your environment configuration.

Option 1 - Set Environment Variables Manually

Add the following environment variables to your ~/.zshrc file. It is not necessary to encrypt the token values.

# Token from nexus.mobilehealth.va.gov
export VA_NEXUS_USER=<Use VA Nexus username provided by the onboarding team>
export VA_NEXUS_PWD=<Use VA Nexus token provided by the onboarding team>

# crowd.mobilehealth.va.gov, if you have a Crowd account
export VA_BITBT_USER=<Use Bitbucket username provided by the onboarding team>
export VA_BITBT_PWD=<Use Bitbucket token provided by the onboarding team>

# dtr.mapsandbox.net
export DTR_USER=<Use Sandbox DTR username provided by the onboarding team>
export DTR_PWD=<Use Sandbox DTR token provided by the onboarding team>
export DTR_URL=dtr.mapsandbox.net

Option 2 - Set Environment Variables Using Shell-Env

Download the shell-env jar file, a stand-alone tool to assist you in setting the required account environment variables. Run the following commands in a terminal to open a shell-env prompt:

java -jar Downloads/shell-env-config-1.0.0-SNAPSHOT.jar

In the prompt, run the command set and enter the username/token values when prompted. Prompts for token values should look like the example below. Once all values have been set, run the display command to confirm your values were set correctly.

? Enter desired value for VA_NEXUS_USER <Use VA Nexus username provided by the onboarding team>
? Enter desired value for VA_NEXUS_PWD <Use VA Nexus token provided by the onboarding team>
? Enter desired value for VA_BITBT_USER <Use Bitbucket username provided by the onboarding team>
? Enter desired value for VA_BITBT_PWD <Use Bitbucket token provided by the onboarding team>
? Enter desired value for DTR_USER <Use Sandbox DTR username provided by the onboarding team>
? Enter desired value for DTR_PWD <Use Sandbox DTR token provided by the onboarding team>
? Enter desired value for DTR_URL dtr.mapsandbox.net

Creating Token Values

To make it easier to maintain your development environment, it is recommended that you create token values for your required VA accounts once you have your credentials.This will prevent you from having to update your environment variables if/when you have to change your passwords.

Bitbucket

This token is necessary in order to perform git operations through the command line or your IDE since the VA requires two factor authentication.Once you have your Crowd access, perform the following steps:

  • Log in to coderepo.mobilehealth.va.gov

  • Select your user account from the upper right corner of the UI and select "Manage Account"

  • From the left side panel, select "HTTP access tokens"

  • Click the "Create token" button

  • Give the token a name, set project permissions to "Project write" (this will set the same value for repository permissions), leave expiry set to "Do not expire", and save the token

  • The generated token will display. Copy this value (it will only display once) and set it as your VA_BITBT_PWD environment variable

  • Ensure that you update any saved values in your keychain, such as IntelliJ login credentials for git. The easiest way to do this is to search for entries in your keychain for "coderepo.mobilehealth.va.gov"

VA Nexus

Once you have your Crowd credentials, you should also have access to the VA Nexus repository. You can generate user and token values for these credentials by performing the following:

  • Log in to nexus.mobilehealth.va.gov with your Crowd credentials

  • Select your user account from the upper right corner of the UI, then select "User Token" from the left side panel

  • Select "Create User Token" (authenticate again, if prompted). This will create a unique user ID and token value. You cannot use your actual user name with the token; you must use the generated user name/token value combination. Set these values for your VA_NEXUS_USER and VA_NEXUS_PWD environment variables

    Once your user/token has been generated, the "Create User Token" button will change to "Access User Token" so that you can access the generated user/token values. You can also reset them by selecting "Reset User Token".

Sandbox DTR

Once you have your Sandbox access, you can create user/token values for repository access following the same steps as for the VA repository:

  • Log in to nexus.mapsandbox.net with your Sandbox credentials

  • Select your user account from the upper right corner of the UI, then select "User Token" from the left side panel

  • Select "Create User Token" (authenticate again, if prompted). This will create a unique user ID and token value. You cannot use your actual user name with the token; you must use the generated user name/token value combination. Set these values for your DTR_USER and DTR_PWD environment variables

    Once your user/token has been generated, the "Create User Token" button will change to "Access User Token" so that you can access the generated user/token values. You can also reset them by selecting "Reset User Token".

Verification Steps

1. Environment Variables

source ~/.zshrc
echo $VA_NEXUS_USER   # Should show your Nexus token username
echo $VA_BITBT_USER   # Should show your Bitbucket username (non-token value)
echo $DTR_USER        # Should show your DTR token username

2. Service Access

Test DTR Access
echo $DTR_PWD | docker login $DTR_URL -u $DTR_USER --password-stdin
Test BitBucket Access
git ls-remote https://coderepo.mobilehealth.va.gov/scm/ckm/common-app-config.git
Test Maven Access
mvn help:evaluate -Dexpression=settings.localRepository

Troubleshooting

Common Issues

Details
  1. Maven Build Failures

    • Check environment variables are set and exported

    • Verify Maven settings.xml exists and is correctly formatted

    • Test direct access to Nexus repository

  2. Git Access Issues

    • Ensure VA_BITBT_PWD is current

    • Check stored credentials in keychain

    • Try manual git command to isolate issue

  3. Container Pull Failures

    • Verify DTR credentials

    • Check Docker is running

    • Test DTR login directly