Setup for Totalview Authentication

To enable Totalview Authentication for Totalview Time you need to have a valid installation of Totalview Suite 2021 or newer running with Totalview Authentication.

Setup Server

Find Totalview Time server folder and open the config file called “TimeServer.exe.config” and set these fields.

Set OAuthEnabled to true
Set Authority to the url of your Totalview Authentication server
Set ApiSecret to secret – or the value store in the Totalview Database registered by Totalview Authentication. It is recommended to generate a new Secret and add it to the TotalviewDB ApiResourceSecrets table (SHA256 encoded)

Finally restart the server.

Example of the .config file:

<configuration>
    ...
    <appSettings>
        ...
        <!-- OAuth -->
        <add key="OAuthEnabled" value="true"/>
        <add key="Authority" value="https://formula.totalview.cloud/TotalviewAuthentication"/>
        <add key="ApiSecret" value="secret"/>
    </appSettings>
</configuration>

Setup Client

Find Totalview Time client folder and open the config file called “TotalviewTimeClient.exe.config” and set these fields.

Set OAuthEnabled to true
Set Authority to the url of your Totalview Authentication server
Set ClientSecret to secret – or the value store in the Totalview Database registered by Totalview Authentication. It is recommended to generate a new Secret and add it to the TotalviewDB ClientSecrets table (See below how to generate one)

Finally increment the tv_version in the .config file at line 2. If this doesn’t exist then add it like this

<?xml version="1.0" encoding="utf-8"?>
<!-- tv_version=1.0.0.0 -->
<configuration>
    ...
    <appSettings>
        ...
        <!-- OAuth -->
        <add key="OAuthEnabled" value="true"/>
        <add key="Authority" value="https://formula.totalview.cloud/TotalviewAuthentication"/>
        <add key="ClientSecret" value="secret"/>
    </appSettings>
</configuration>

Setup Time Admin

Find Totalview Time Admin folder and open the config file called “Web.config” and set these fields.

Set UseTotalviewAuthentication to true
Set Authority to the url of your Totalview Authentication server
Set ClientSecret to secret – or the value store in the Totalview Database registered by Totalview Authentication. It is recommended to generate a new Secret and add it to the TotalviewDB ClientSecrets table (See below how to generate one)
Set RedirectUri to http(s)://[PUBLIC URL OF TIME ADMIN]/LoginResultCallback.aspx
Set PostLogoutRedirectUri to http(s)://[PUBLIC URL OF TIME ADMIN]

In the Web.config file Change the Authentication Mode to None

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <appSettings>
        <add key="UseTotalviewAuthentication" value="true" />
        <add key="Authority" value="https://formula.totalview.cloud/TotalviewAuthentication"/>
        <add key="ClientSecret" value="secret"/>
        <add key="RedirectUri" value="https://formula.totalview.cloud/Time/LoginResultCallback.aspx"/>
        <add key="PostLogoutRedirectUri" value="https://formula.totalview.cloud/Time"/>
    </appSettings>
    ...
</configuration>

Go to the Totalview Database and in the “ClientRedirectUris” and “ClientPostLogoutRedirectUris” tables update the registered urls for the Totalview Time Admin client. They should be the same as registered in the Web.Config

Setup Reports

See Setup for Totalview Authentication

Generate client secret

This will generate the value for a client secrete ‘secret’, and can be inserted into the ClientSecrets table.

DECLARE @HASHBYTES VARBINARY(128) = hashbytes('sha2_256', 'secret')
SELECT cast(N'' as xml).value('xs:base64Binary(sql:variable("@HASHBYTES"))', 'varchar(128)');