Integration Framework tokens

The IF tokens are a way to set up a JWT token that is sent from the client to the LS One Integration Framework. The Integration Framework will examine the token and verify that it's contents have a matching entry on the LS One side. This is to prevent unauthorized requests being made to the Integration Framework.

Token format

When sending requests to the Integration Framework via HTTP/HTTPS the token should be placed in the Authorization header. When making Net.TCP requests in code you must add a header to the message called "Authorization" and place the token there. See Integration Framework Authentication for more information and samples.

Create the token in LS One

  1. In the Site Manager navigate to Sites -> Site service -> Integration framework tokens.
  2. Add a new token with the following information:
    1. Description: You can put anything you want in here but preferably have something descriptive about the sender.
    2. Sender: This has to be the host name that the Site Service is receiving from the sender (case insensitive).
    3. User: Select an admin user here.
    4. Store: Select any store from the list, e.g. HQ/Store.
    5. Press the Generate button and copy the value to the clipboard.

      You need this value in the next step, so paste it to Notepad or somewhere to store it in the meantime.

  3. Press the Activate button to close the dialog and create the token.

 

Troubleshooting: How to find the host name

When setting up the token you need to have the host name as it will appear to the Integration Framework at the time the request comes in. There are two possible ways to do this.

  1. Ping the host machine from a console (Command Prompt) and note down the full host name that it resolves to. This will be the host name you use for Sender when setting up the token.
  2. Make the Integration Framework reject a request so that we can see the host name it's rejecting.
    1. From your client application make a request to the Integration Framework without setting up a token. The request will be denied but you will now be able to see the host name in the Site Service log file located here: C:\ProgramData\LS Retail\LS One Site Service\Logs
    2. Look for an entry that matches the time of the request you made. It should look like this: [Receiving IF request from: <some host hame>]
  3. From LinqPad:
    1. add reference to System.Net assembly and add System.Net namespace to the query
    2. run
      IPHostEntry machineName = Dns.GetHostEntry("localhost");
      Console.WriteLine("DNS for current machine: " + machineName?.HostName);