---
title: "Site authentication"
id: "site_authentication"
project: "Ratings & Reviews"
url: "https://docs.bazaarvoice.com/articles/ratings-reviews/site_authentication"
updated: 2026-11-16T14:07:03Z
---

# Site authentication

Authentication is the process of confirming a user's identity, and it provides a way to ensure that legitimate users create content on your site. Through authentication, Bazaarvoice can confirm a user's email address and link the email address to a profile in the Bazaarvoice network. (Authentication is not how fraud is detected; that's [authenticity](/articles/ratings-reviews/authenticity).)

**Note:**  [Hosted authentication](/articles/ratings-reviews/user_authentication) is the recommended method of authentication. Site authentication significantly decreases the volume of user submissions, and it requires that your technical team perform additional integration work to tie Ratings & Reviews to your site’s sign-in process. Use site authentication only if you have a legal or business requirement that necessitates that your customers sign in to Ratings & Reviews.

# Quick start 
 
Site authentication requires users to sign in to your site’s authentication system. Before users can submit product reviews, questions, or answers, they must sign in with the same credentials they used to access your site. Use this method only if you have a legal or business requirement that requires your customers sign in to Ratings & Reviews.
 
For an overview of site and hosted authentication, including a workflow of each, refer to [User authentication](/articles/ratings-reviews/user_authentication).
 
1. Sign in to the [Bazaarvoice Portal](https://portal.bazaarvoice.com/).
2. From the upper-right corner, select the **Settings** icon ![settings icon](/resources/Storage/ratings-reviews/user_authentication/portal_settings_icon.png).
3. Under **Configuration**, select **Ratings & Reviews**. The **Site Manager**lists all your active deployment zones and implementations.
4. From the **Implementations** section, select **Edit** next to the [implementation](/articles/ratings-reviews/config_hub_overview/a/implementations) you want to configure.
5. Select **User authentication**under Settings and then perform these tasks:
    1. Select the **Site Authentication Integration** tab.
    2. Enable the **Require site authentication** option.
    3. Enable the [**Inject nickname data** option](https://support.bazaarvoice.com/s/article/Submission-form-data-injection#UserNickname) (optional).
    4. Set **Request email address on submission** to **Required**. If set to **Required**, ensure the email address is passed in the request body.
    5. Enter a web address (URL) for **Staging site login URL**. Test users on your staging site will be redirected to sign in here before writing reviews.
    6. Enter a web address (URL) for **Production site login URL**. Users on your production site will be redirected to sign in here before writing reviews.
6. Select **Technical Setup** and then copy the **Shared Encoding Key**.
7. [Generate a user authentication string (UAS)](/articles/ratings-reviews/site_authentication/a/h3_1538389499).
8. [Include the UAS token](/articles/ratings-reviews/site_authentication/a/h3__59792953) in the integration code on your product display pages.
9. Ensure the sign-in page redirects to the container page when the `bveventid` query parameter is present.

Refer to these [code examples ![Opens in new tab](/resources/Storage/ratings-reviews/sdk/external-link.svg)](https://github.com/bazaarvoice/HostedUIResources/tree/master/UserAuthentication)as needed.
 
# In-depth 
 
Site authentication requires users to sign in to your site’s authentication system. Before users can submit product reviews, questions, or answers, they must sign in with the same credentials they used to access your site. Use this method only if you have a legal or business requirement that necessitates that your customers sign in to Ratings & Reviews.
 
Here is the workflow of hosted and site authentication:

| Hosted Authentication | Hosted Authentication |
| --- | --- |
| ![](/resources/Storage/ratings-reviews/conversations/en_US/Collect/images/hosted_auth_write_a_review.png) | ![](/resources/Storage/ratings-reviews/conversations/en_US/Collect/images/hosted_auth_pie.png) |
 
 | Site Authentication |
| --- |
| ![](/resources/Storage/ratings-reviews/conversations/en_US/Collect/images/site_auth.png) |

## Integrate with Ratings & Reviews 
 
To successfully integrate with Ratings & Reviews and require site authentication, you must perform these tasks.
 
### Step 1: Enable and configure site authentication 
 
Complete the following steps to set up site authentication in Ratings & Reviews:

1. Sign in to the [Bazaarvoice Portal](https://portal.bazaarvoice.com) ![Opens in new tab](/resources/Storage/ratings-reviews/sdk/external-link.svg).
2. From the upper-right corner, select the settings icon ![settings icon](/resources/Storage/ratings-reviews/user_authentication/portal_settings_icon.png).
3. Under **Configuration**, select **Ratings & Reviews**. The **Site Manager**lists all your active deployment zones and implementations.
4. From the **Implementations** section, select **Edit** next to the [implementation](/articles/ratings-reviews/config_hub_overview/a/implementations) you want to configure.
5. In the **Settings** section of the configuration hub, select **User authentication**.
6. At the top of the User Authentication page, select the **Site Authentication Integration** tab to display the Authentication Integration page.
7. Enable the **Require site authentication** option.
8. Determine whether you want to enable the **Inject Nickname Data** option. Refer to [Data injection](/articles/ratings-reviews/single-product-submission-form/a/data-injection) for information about injecting nickname data.
9. Use the **Request** **email address on submission**options to specify whether an email address is required, optional, or not requested when users submit reviews, comments, questions, or answers:
    * **Required**—An email address is required for submissions. This is the default option. For site authentication, ensure the email address is passed in the request body.
    * **Optional**—An email address is optional for submissions.
    * **Not Requested**—The email address is excluded from submission forms.
10. Enter a web address (URL) for **Staging site login URL**. Test users on your staging site will be redirected to sign in here before writing content.
11. Enter a web address (URL) for **Production site login URL**. Users on your production site will be redirected to sign in here before writing content. 
 ![Site authentication configuration](/resources/Storage/ratings-reviews/site_authentication/Screenshot%202025-12-03%20at%204.00.38%E2%80%AFPM.png)

### Step 2: Host a container page and reference its URL from Ratings & Reviews 
 
The container page facilitates site authentication redirects.
 
[Create the container page](/articles/ratings-reviews/container_page/a/Create) on the same domain where Ratings & Reviews is integrated. Typically, this is the domain from which your product pages are served. If your implementation uses `bv.js`, it should contain the following content:
 
```html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8"/>
    <title></title>
    <meta name="robots" content="noindex, nofollow">
    <link rel="canonical" href="container.htm"/>
    <meta name="bv:pageType" content="container">
  </head>
  <body>
    <script async src="https://apps.bazaarvoice.com/deployments/<client_name>/<site_ID>/<environment>/<locale>/bv.js"></script>
  </body>
</html>​
```
 **Note:** If your existing implementation uses the scout file (`bvapi.js`), your HTML document should look similar to the following: 
 
```html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8"/>
    <title></title>
    <meta name="robots" content="noindex, nofollow">
    <link rel="canonical" href="container.htm"/>
  </head>
  <body>
    <script type="text/javascript" src="https://display.ugc.bazaarvoice.com/bvstaging/static/<client_name>/<site_ID>/<locale>/bvapi.js"></script>
    <script>
      $BV.container('global', {} );
    </script>
  </body>
</html>
```

 
Replace `container.htm` with the relative path to the canonical URL of this page, and replace *&lt;client\_name&gt;*, *&lt;site\_ID&gt;*, *&lt;environment&gt;*, and *&lt;locale&gt;* with your values.
 **Note:** A canonical URL contains metadata about the page. The metadata points search engines to the official address of a page. For example, if you do not want search engines to treat `https://url.com?page=1` and `https://url.com?page=2` as different pages, provide an absolute link, such as `<link rel="canonical" href="https://url.com">`, to instruct search engines to point both URLs to `https://url.com`.
 
After creating the container page, you must enter its URL in Ratings & Reviews by doing the following:

1. In the configuration hub, go to **Technical Setup** &gt; **Site Profile**.
2. Enter the container page URL in **Container URL**.
3. In the configuration hub, go to **Settings** &gt; **User Authentication**.
4. Select the **Site Authentication Integration** tab.
5. Enter the staging site sign-in URL in **Staging site login URL**.
6. Enter the production site sign-in URL in **Production site login URL**.

###  Step 3: Generate a user authentication string (UAS) 
 
A user authentication string (UAS) consists of key-value pairs that are hashed and encoded (but not encrypted). This string enables Bazaarvoice to verify that it comes from a trusted source, thereby preventing third parties from fabricating or impersonating users. You can use a UAS, for example, to [inject data](https://support.bazaarvoice.com/s/article/Submission-form-data-injection#UserNickname) into a review submission form if your implementation uses site authentication.
 **Note:** A UAS must be created server-side to maintain the secrecy of the shared key.
 
Follow these steps to create a UAS that can be used in data injection:

1. Determine the key-value pairs to include in the UAS, which must be delimited in the string by ampersands (&). Here are the supported keys: 

    | Key | Description | Required |
    | --- | --- | --- |
    | `date` | Today's date, in the format YYYYMMDD or YYYY-MM-DD. | Yes |
    | `userid` | Consumer's user ID. Do not use an email address for this value. | Yes |
    | `emailaddress` | Contributor's email address. This value must be URL-encoded. | Yes |
    | `maxage` | Number of days before the UAS expires. The default number of days is 1. Increasing this value is useful in pre-authenticated URLs, such as those used in email campaigns. | No |
    | `verifiedpurchaser` | Whether the user is verified to have purchased one or more products (**True**). Omit this parameter or set it to **False** if the user is not a verified purchaser. Learn more about the [verified purchaser badge](/articles/ratings-reviews/verified-purchaser-badge). | No |
    | `subjectids` | A list of product external IDs that the user is verified to have purchased, thereby ensuring that the `verifiedpurchaser` key cannot be applied to other products. If you specify multiple IDs, separate them using a slash (/). | No |
    | `Age` | Age range without spaces. For example: **35to44** or **65orOver**. | No |
    | `Gender` | The user's gender (**Male** or **Female**). | No |
    | `IncentivizedReview` | Whether the contributor received a free product or service to review (**True**). Omit this parameter or set it to **False** if the user did not receive a free product or service. Learn more about[incentivized review badges](/articles/ratings-reviews/incentivized-badge). | No |
    | `OrderNumber` | Order ID of the contributor's purchase. | No |
    | `username` | Contributor's user name. | No |
    | `affiliation` | Automatically adds the default Staff affiliation badge (![](/resources/Storage/ratings-reviews/conversations/en_US/Display/images/badge_staff.PNG)) to submissions that use this URL. This badge indicates that the person writing the review is employed by your company. Learn more about [staff badges](/articles/ratings-reviews/staff-badge). Set this parameter to **staff**. | No |
2. If a key-value pair includes a reserved character, you must [URL-encode ![Opens in new tab](/resources/Storage/ratings-reviews/sdk/external-link.svg)](https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_in_a_URI)the character. 
    For example, the string **Jacob'sLadder** must be encoded to **Jacob%27sLadder**.

### Step 4: Encode the UAS 
 
Hash and encode the UAS along with your Bazaarvoice shared encoding key to create a UAS token.

1. To find your shared encoding key, click **Technical Setup** » **Site Profile** in the configuration hub. Under **Basic Information**, copy the value from the **Shared Encoding Key** field.
2. Create a URL-encoded query string that includes required and optional parameters, as in this example:
 
```
date=20250915&userid=shopper123&emailaddress=joe.bloggs%40company.com&maxage=30&verifiedpurchaser=True&subjectids=product1/product2


```

3. Create a signature by hashing the URL-encoded parameter string with the encoding key.
4. Hex-encode the URL-encoded parameter string.
5. Combine the signature and parameter strings.

#### Examples: 
 ▶ [Pseudo-code example](javascript:void%280%29)
 ▼ [Pseudo-code example](javascript:void%280%29)
 
```java
function makeUserToken(encodingKey, parameters) {
  // encode the signature using HMAC SHA-256
  signature = hash_hmac('sha256' , parameters, encodingKey)
  
// return the user authentication string
return uas
}

ENCODING_KEY = 'abcd1234'   // BV shared key from config hub
requiredParameters = 'date=20161225&userid=valuedCustomer'
extraParameters = 'maxage=90&verifiedpurchaser=True'
allParameters = requiredParameters + '&' + extraParameters

userAuthString = makeUserTokenHmac(ENCODING_KEY, allParameters)
```

 ▶ [Java example](javascript:void%280%29)
 ▼ [Java example](javascript:void%280%29)
 
```java
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Hex;
import java.nio.charset.StandardCharsets;

public String makeUserTokenHmac(String encodingKey, String parameters)
{
Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
SecretKeySpec secret_key = new SecretKeySpec(encodingKey.getBytes(), "HmacSHA256");
sha256_HMAC.init(secret_key);

String hash = Hex.encodeHexString(sha256_HMAC.doFinal(parameters.getBytes()));
String hexParameters = Hex.encodeHexString(parameters.getBytes(StandardCharsets.UTF_8));


return hash + hexParameters;
}
```

 ▶ [JavaScript on Node.js example](javascript:void%280%29)
 ▼ [JavaScript on Node.js example](javascript:void%280%29)
 
```javascript
var crypto = require('crypto');

function makeUserTokenHmac(encodingKey, parameters) {
let hmac  = crypto.createHmac('sha256', encodingKey).update(parameters);
let signature = hmac.digest('hex');

let hexParameters = parameters.split('')
.map(c => c.charCodeAt(0).toString(16))
.join('');


return signature + hexParameters;
}
```

 ▶ [Ruby example](javascript:void%280%29)
 ▼ [Ruby example](javascript:void%280%29)
 
```ruby
require 'openssl'

def makeUserTokenHmac(encodingKey, parameters)
hash = OpenSSL::HMAC.digest('sha256', encodingKey, parameters)
signature = hash.unpack('H*').first

hexParameters = parameters.unpack('H*').first


return "##"
end
```

 ▶ [PHP example](javascript:void%280%29)
 ▼ [PHP example](javascript:void%280%29)
 
```php
<?php
function makeUserTokenHmac($encodingKey, $parameters) {
// encode the signature using HMAC SHA-256
$signature = hash_hmac('sha256' , $parameters, $encodingKey);

// concatenate the signature and hex-encoded string of parameters
$uas = $signature . bin2hex($parameters);


// return the user authentication string
return $uas;
}
?>
```

 ▶ [C# example](javascript:void%280%29)
 ▼ [C# example](javascript:void%280%29)
 
```csharp
using System;
using System.IO;
using System.Text;
using System.Security.Cryptography;


namespace uasC {
class Program {
static void Main(string[] args) {
const string SharedKey = "SHAREDKEYGOESHERE";
string userId = "date=20190708&userid=9100040964&maxage=30";
using(HMACSHA256 hmac = new HMACSHA256(Encoding.UTF8.GetBytes(SharedKey))) {
string userIdSignature = BytesToHexString(hmac.ComputeHash(Encoding.UTF8.GetBytes(userId)));
string hexUserId = BytesToHexString(Encoding.UTF8.GetBytes(userId));
Console.WriteLine(userIdSignature + hexUserId);
}
string BytesToHexString(byte[] input) {
StringBuilder sb = new StringBuilder(64);
for (int i = 0; i < input.Length; i++) {
sb.Append($ "{input[i] :X2}");
}
return sb.ToString();
}
}
}
}
```

 
###  Step 5: Provide a UAS token 
 
If you are using BV loader (`bv.js`), set up integration code to include the generated UAS token in a meta element in the page head element. Include this token on any pages you have Ratings & Reviews integration code, such as on your product pages. This property should be provided when users are signed into your site’s authentication system, signaling to Bazaarvoice that the user is signed in.
 
For example:
 
```html
<head>
...
<meta name="bv:userToken" content="17743067190f0343f24f7" >
...
</head>
```
 
Always place `meta` tags (such as `userToken`) before the BV loader (`bv.js`) script tag. When the BV loader loads, it only sees what is visible in the DOM at that time. If a `meta` tag is placed after the BV loader, it won't be visible to the BV loader at load time. If it is placed before the BV loader, it will be visible.
 
For users who are not signed in to your authentication system, leave the `userToken` property blank (or leave it out of the integration code).
 **Note:** If your existing implementation uses the scout file (`bvapi.js`), set up integration code to include the generated UAS token in the `$BV.configure()` function call instead. For example: 
 
```javascript
$BV.configure('global', {
  productId: 'test1',
  userToken: '17743067190f0343f24f75df730dfe58646174653d323031332d30352d3031267573657269643d7465737475736572313233'
});
```

 
###  Step 6: Redirect the user to your container page 
 
If you plan to send links to users and ensure they remain signed in, you can include the `bveventid` query parameter to ensure that the sign-in pages (set in the configuration hub) redirect users to your hosted Ratings & Reviews container page. The `bveventid` parameter signals that the user was trying to write a review before he was redirected to sign in. The redirect must include:

* The `bveventid` parameter, with its complete, unmodified value. For example: 
```
bveventid=1234asfr

```

* The UAS token; for example: 
```
bvuserToken=17743067190f0343f24f75df730dfe58646174653d323031332d30352d3031267573657269643d7465737475736572313233

```


The URL should look similar to this:
 
```
https://www.example.com/container.htm?bveventid=123asfr&bvuserToken=17743067190f0343f24f75df730dfe58646174653d323031332d30352d3031267573657269643d7465737475736572313233

```
 
##  Test your site authorization integration 
 
Follow these steps to test and, if needed, troubleshoot your integration:

1. Browse to your Ratings & Reviews page, and then select the "write a review" link. You should be redirected to your sign-in page and see the `bveventid `in the page URL. If you are not redirected, then site authentication is not enabled. Contact Bazaarvoice for assistance.
2. After successful sign-in, verify that you are redirected to the container page, and that the` bveventid` and UAS token are present in the container page URL. If they are not present, then you may not be correctly checking for the` bveventid`, and should check to ensure you have precisely followed the integration steps.
3. Verify that you are then redirected to the product page (where you selected "Write a review"), and that the submission form is present. (Verify that the `bveventid` is present, and that it matches the one you verified in Step 1). Further, verify that the UAS token is present and valid.

[![Provide feedback button](/resources/Storage/ratings-reviews/bv-global/topic-footer-2026/provide-feedback-button.png)](https://docs.google.com/forms/d/1qGZ5rApqDrXO_j6vNzcDihDAOPMEjmUr1alHvcEIbQU/edit)