Skip to content

BVSDK UserAuthentication

Tim Kelly edited this page Dec 18, 2015 · 4 revisions

Both the BVAdvertising and BVRecommendations modules support adding an authenticated user for shopper profile matching.

Once a user is authenticated inside your user login workflow, the user authentication token can be set via BVSDKManager#setUserWithAuthString().

NOTE: The authentication token created with your existing Bazaarvoice implementation logic needs to be provided to the BVSDKManager. However, the steps to encrypt your authentication token are still applicable even if you are not a Conversations client.

Adding information about the user

The user auth string is an encrypted query string. In the documentation above, date=2007­0527&userid=ID12345 is used as an example. This is then encrypted/signed appropriately, for security. You should add information (such as identity, demographics) in this query string, for example: date=2007­0527&userid=ID12345&facebookId=abc123&age=28&gender=female. Allowed keys (userid, gender, age, etc) are defined in BVAuthenticatedUser.h This information can then be safely passed like the examples below:

Example Auth String - for testing purposes

This profile below interested in "pets", "powersports", "gamefish" and others. See the Contextual Interests section below for further explanation.

Objective-C

[[BVSDKManager sharedInstance] setUserWithAuthString:@"aa05cf391c8d4738efb4d05f7b2ad7ce7573657269643d4f6d6e694368616e6e656c50726f66696c65313226656d61696c3d6a61736f6e406a61736f6e2e636f6d"];

Swift

BVSDKManager.sharedInstance().setUserWithAuthString("aa05cf391c8d4738efb4d05f7b2ad7ce7573657269643d4f6d6e694368616e6e656c50726f66696c65313226656d61696c3d6a61736f6e406a61736f6e2e636f6d")

Once setAuthenticatedUser has been called from the BVSDKManager, Bazaarvoice's back-end systems will begin matching data to this user's profile. This process is near real-time, but not instant. The SDK will poll to update the user profile and should reflect the user's interests within seconds.