User Token File - techtalk/SpecLog-Resources GitHub Wiki

User token files contain the license key and information for authenticating clients with the server.

User token files are plain text XML files with the .sltoken extension.

Generating User Token Files

User token files can either be generated by the client (if you have a user license) or the server (if you have a server license).

  • Server license: To generate a user token on the server, create a new user with SpecLog.UserManager:
    >SpecLog.UserManager.exe create <[email protected]> <FirstName> <LastName> This adds a new user on the server as well as a user token file containing the server license. This user token file contains the same server URL as the admin token file used by SpecLog.UserManager.exe. you can change the URL by manually editing the ServerUrl property in the user token file. If you have changed your server URL, use >SpecLog.ServerManager.exe rebase to update the user token files on the server with the new URL.

  • User license: To generate a user token from within the client, first register your client license key on the client. Once you have done this, click on the licensee name in the upper right corner of the SpecLog client to save the user token file containing the client license:
    Clicking on licensee name saves the user token file

Registering User Token Files

User token files needs to be registered on the server or the client, depending on where they were created.

Registering user token files on the server

  • User token files generated by the server are automatically registered on the server when creating the user account. If you delete a user on the server, you can re-register the user token file using SpecLog.ServerManager.
  • User token files generated by the client need to be registered on the servers they are used to connect to and the user needs to be added to the server with SpecLog.ServerManager.

Installing user token files on the client

To register user tokens on the client, either:

  • Double-click on a .sltoken file to register the user token file on the client. The client copies the token file to the %appdata%\SpecLog\Tokens directory with the name <TokenId/>.sltoken.
  • Manually copy the token files to the %appdata%\SpecLog\Tokens directory on the client.

Multiple user token files can be used by the same client.

User token resolution with multiple tokens installed on the client

A client can have multiple user tokens installed in the %appdata%\SpecLog\Tokens directory.

When connecting to a server, SpecLog first attempts to authenticate using the client-generated tokens (containing '*' in the ServerUrl). If SpecLog is unable to access the server using these tokens, SpecLog attempts to access the server using the server-generated tokens containing the base URL (Url.Authority) of the server.

Updating the Server URL

When connecting to a server, the client must present a matching user token file to authenticate.

The client matches the server address specified in the connection dialog to the ServerUrl property stored in the installed user token files.

The initial value of the serverUrl property is initialized from the SpeclogServerUrl key configured in the <appSettings/> of SpecLog.UserManager.exe.config, when the user token is created with SpecLog.UserManager.exe.

When the server URL changes, the clients need to update the ServerUrl property in their installed user token files. This can be done by manually editing the user token file with a text editor.

To have the new URL also used when generating further user tokens on the server, the administrator needs to also update SpecLog.UserManager.exe.config.

The SpecLog server also stores each generated user access token in the server database. You can update the serverUrl property of existing user access tokens stored in the server database with the >SpecLog.ServerManager.exe rebase command. However, this is only relevant when you extract an existing user token file from the server again, so that it already contains the updated URL. The serverUrl property of a user access token stored on the server has no effect on the server authenticating users.

User Token File Contents

The user token file contains the following information:

Element name Description
ServerUrl The URL of the server where the token is used for authentication. This value must match the Server name specified in the connection dialog (also stored in the local repository cache file). Token files generated on the client contain * as the URL. These tokens can be used to access any server.
PrivateKeyXml The private key used for public/private key authentication.
TokenId Unique ID of the token.
LicenseKey License key generated by the server or client.
IssuedTo Name the license key is registered to. This does not have to match the user name on the server.
⚠️ **GitHub.com Fallback** ⚠️