Friday, 7 October 2016

The following instructions will walk you through building and running the Node.js server for authentication. Looking to authenticate using a mobile app instead? See instructions for Android, and iOS.
NOTE: The server implementation does not use persistent storage; everything is stored in memory. Therefore, if you shut down the server, you will lose your tokens.
To run the server, follow these instructions:
  1. Open a command prompt.
  2. Change directories to {REFERENCE_IMPLEMENTATION}/samples/companionService
  3. To install dependencies, type: npm install.
  4. In a web browser, visit the Login with Amazon developer portal.
  5. Near the top of the page, select your security profile from the drop down menu and click Confirm.
  6. Enter a privacy policy URL beginning with http:// or https://. For this example, you can enter a fake URL such as http://example.com. Optionally, you can choose to upload an image, which will be shown on the Login with Amazon consent page. Click Save.
  7. Next to Security Profile, click Show Client ID and Client Secret. This will display your client ID and client secret. Save these values.
  8. In your favorite text editor, open {REFERENCE_IMPLEMENTATION}/samples/companionService/config.js and edit the following values:
    • clientId: Paste in your client ID as a string.
    • clientSecret: Paste in your client secret as a string.
    • products: The products object consists of a key that should be the same as the product ID (also referred to as Device Type ID) that you set up in the developer portal and an array of unique product identifiers. For this project, the array should be a single value, and match the serial number you entered while generating certificates.
  9. Save the config.js.
  10. From your command prompt, run the following: npm start.
The server is running. You are now ready to run the sample app.

No comments:

Post a Comment