Basic
The easiest administrative access
Basic authentication sends user credentials with each HTTP request as a Base64-encoded value. Because Base64 provides encoding rather than encryption, this method offers limited security and is best suited for trusted environments where the request travels over HTTPS.
Include the encoded credentials in the Authorization header using the following format:
Authorization: Basic base64(APP_KEY:SECRET)Supply your Hash-based Message Authentication Code (HMAC) APP_KEY as the username and SECRET as the password. HTTP clients such as Postman generate the required authorization header automatically. When your client does not support Basic authentication, encode the APP_KEY:SECRET value using Base64 and include it in the request.
cURL example
Use this curl command to send a GraphQL query authenticated with Basic credentials.
curl -X POST "https://cg.optimizely.com/content/v2" \
-H "Authorization: Basic BASE64_ENCODED_CREDENTIALS" \
-H "Content-Type: application/json" \
-d '{"query": "{ BlogPost { total } }"}'
NoteUse
echo -n "username:password" | base64to encode your credentials.
Updated 7 days ago
