Test your Facebook integration

In this lesson, you test your JPA code to ensure that you can access and work with Facebook user information.

Procedure

  1. Log in to your Aurora B2B starter store as a Site Administrator.
    Note: Logging in to the store sets up the security tokens so that you can make REST calls from Swagger. Although you can still view the REST resources in Swagger, failing to log in to the store with the appropriate permissions might prevent you from running any REST calls from Swagger.
    1. Open the Aurora B2B starter store in a web browser. Go to https://localhost/webapp/wcs/stores/servlet/en/aurorab2besite.
    2. Click Sign In/Register and log in to the store as a Site Administrator.
      For example, wcsadmin.
  2. After you log in, go to https://localhost/webapp/wcs/stores/servlet/swagger/index.html to access the Swagger user interface.
  3. Use Swagger to verify the custom Rest resource handler.
    URL: https://localhost/wcs/resources/store/1/person
    Method: POST
    Header: Content-Type=application/json
    Post Body:
    {
    "logonId":"testUser001",
    "logonPassword":"XXX",
    "logonPasswordVerify":"XXX",
    "ext_facebookId":"testUser001@a.com",
    "ext_facebookName":"data001"
    }
    
  4. Check the XSOCIALACCOUNT table to see whether the Facebook account data is inserted.
    SELECT * FROM XSOCIALACCOUNT

Results

If the data is correctly inserted, the response is similar to the following example code.
{
        "WCToken": “XXX”,
        "userId": "7002",
        "personalizationID": "1508487538324-1",
        "WCTrustedToken": “XXX”,
        "addressId": "3672571730"
    }