Client Security Configuration: Difference between revisions

From Maria GDK Wiki
Jump to navigation Jump to search
(Created page with "Client security Category:Security")
 
No edit summary
 
Line 1: Line 1:
Client security
==
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:
<source lang="csharp">
namespace TPG.OidcConnect.Contracts
{
    public interface IAccessTokenProvider
    {
        string GetAccessToken();
        Task<string> GetAccessTokenAsync();
        string GetAccessTokenHeaderName();
    }
}
</source>
 
 




[[Category:Security]]
[[Category:Security]]

Latest revision as of 15:16, 4 May 2023

== 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();
    }
}