applicationId uz neni povinne
This commit is contained in:
@@ -28,12 +28,12 @@ public sealed class RequestCredentialsProvider
|
||||
|
||||
var clientId = HeaderOrDefault(headers, CredentialConstants.ClientIdHeader, _settings.ClientId);
|
||||
var clientSecret = HeaderOrDefault(headers, CredentialConstants.ClientSecretHeader, _settings.ClientSecret);
|
||||
// ApplicationId is optional: iDoklad's standard client_credentials grant does not require it.
|
||||
var applicationId = HeaderOrDefault(headers, CredentialConstants.ApplicationIdHeader, _settings.ApplicationId);
|
||||
|
||||
var missing = new List<string>();
|
||||
if (string.IsNullOrWhiteSpace(clientId)) missing.Add(CredentialConstants.ClientIdHeader);
|
||||
if (string.IsNullOrWhiteSpace(clientSecret)) missing.Add(CredentialConstants.ClientSecretHeader);
|
||||
if (string.IsNullOrWhiteSpace(applicationId)) missing.Add(CredentialConstants.ApplicationIdHeader);
|
||||
if (missing.Count > 0)
|
||||
{
|
||||
throw new MissingCredentialsException(missing);
|
||||
@@ -43,7 +43,7 @@ public sealed class RequestCredentialsProvider
|
||||
{
|
||||
ClientId = clientId!,
|
||||
ClientSecret = clientSecret!,
|
||||
ApplicationId = applicationId!,
|
||||
ApplicationId = string.IsNullOrWhiteSpace(applicationId) ? null : applicationId,
|
||||
Language = ResolveLanguage(headers),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user