Client Security Configuration

From Maria GDK Wiki
Jump to navigation Jump to search

== Client service calls need to include a valid JWT access token if service security is enabled. This must be included in a request header named "Authorization". The token must be verifiable according to "SecuritySettings" in the services settings.json.

In order to use the GDK client libraries (TPG.ServiceModel) to automatically insert the header for all service calls, set TPG.ServiceModel.AuthenticationHandler.Instance.AccessTokenProvider to a token provider:

namespace TPG.OidcConnect.Contracts
{
    public interface IAccessTokenProvider
    {
        string GetAccessToken();
        Task<string> GetAccessTokenAsync();
        string GetAccessTokenHeaderName();
    }
}