コード例 #1
0
        /// <summary>
        /// Try to get the client id from the HTTP body or HTTP header.
        /// </summary>
        /// <param name="instruction">Authentication instruction</param>
        /// <returns>Client id</returns>
        private static string?TryGettingClientId(AuthenticateInstruction instruction)
        {
            var clientId = ClientAssertionAuthentication.GetClientId(instruction);

            if (!string.IsNullOrWhiteSpace(clientId))
            {
                return(clientId);
            }

            clientId = instruction.ClientIdFromAuthorizationHeader;
            return(!string.IsNullOrWhiteSpace(clientId)
                ? clientId
                : instruction.ClientIdFromHttpRequestBody);
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AuthenticateClient"/> class.
 /// </summary>
 /// <param name="clientRepository">The client repository.</param>
 /// <param name="jwksStore">The key store.</param>
 public AuthenticateClient(IClientStore clientRepository, IJwksStore jwksStore)
 {
     _clientAssertionAuthentication = new ClientAssertionAuthentication(clientRepository, jwksStore);
     _clientRepository = clientRepository;
 }