Step 1: Generating Authentication Token
In order to obtain a wallet for accessing to the RDS ADW database through your private endpoint, you will need an access token.
# Assign your client id and secret to environment variables.
# Replace your_client_id and your_client_secret with the # credentials obtained when creating your OAuth 2.0 client.
CLIENT_ID="your_client_id"
CLIENT_SECRET="your_client_secret"
# Combine the client ID and secret, then encode in Base64
# Assign the result to an environment variable
ENCODED_CREDS=$(echo -n "${CLIENT_ID}:${CLIENT_SECRET}" | base64 -w 0)
echo "Encoded Base64 credentials: $ENCODED_CREDS
# Use cURL to obtain the authentication token
RESPONSE=$(curl --location --request \
POST "https://<idcs authorization server host>/oauth2/v1/token" \
--header "Content-Type: application/x-www-form-urlencoded" \
--header "Authorization: Basic ${ENCODED_CREDS}" \
--data-urlencode "grant_type=client_credentials" \
--data-urlencode "scope=urn:opc:idm:__myscopes__")
# Extract the token using jq
ACCESS_TOKEN=$(echo ${RESPONSE} | jq -r .access_token)
echo ${ACCESS_TOKEN}