init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
20
Kreta.Client/KGR/Extension/ClientConfigurationExtension.cs
Normal file
20
Kreta.Client/KGR/Extension/ClientConfigurationExtension.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
using System.Collections.Generic;
|
||||
using Kreta.Client.KGR.Configuration;
|
||||
using Kreta.Client.KGR.Constant;
|
||||
|
||||
namespace Kreta.Client.KGR.Extension
|
||||
{
|
||||
internal static class ClientConfigurationExtension
|
||||
{
|
||||
public static Dictionary<string, string> GetTokenRequestParameters(this IKGRClientConfiguration kgrClientConfiguration)
|
||||
{
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
{ TokenRequest.GrantType, GrantType.ClientCredentials },
|
||||
{ TokenRequest.ClientId, kgrClientConfiguration.PrivateClientId },
|
||||
{ TokenRequest.ClientSecret, kgrClientConfiguration.PrivateClientSecret },
|
||||
{ TokenRequest.Scope, Scope.Private },
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
51
Kreta.Client/KGR/Extension/HeaderExtension.cs
Normal file
51
Kreta.Client/KGR/Extension/HeaderExtension.cs
Normal file
|
@ -0,0 +1,51 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Kreta.Client.KGR.Extension
|
||||
{
|
||||
internal static class HeaderExtension
|
||||
{
|
||||
public static Dictionary<string, string> GetAuthorizationHeaderWithMulitpartFrom(this string token)
|
||||
=> new Dictionary<string, string>
|
||||
{
|
||||
{ "Content-Type", "multipart/form-data" },
|
||||
{ "Authorization", $"Bearer {token}" },
|
||||
};
|
||||
|
||||
public static Dictionary<string, string> GetAuthorizationHeaderWithJson(this string token, string intezmenyGuid)
|
||||
=> new Dictionary<string, string>
|
||||
{
|
||||
{ "Content-Type", "application/json" },
|
||||
{ "Authorization", $"Bearer {token}" },
|
||||
{ "IntezmenyId", $"{intezmenyGuid}" }
|
||||
};
|
||||
|
||||
public static Dictionary<string, string> GetAuthorizationHeaderWithJson(this string token, string intezmenyGuid, string oktatasiAzonosito, string idpEgyediazonosito)
|
||||
=> new Dictionary<string, string>
|
||||
{
|
||||
{ "Content-Type", "application/json" },
|
||||
{ "Authorization", $"Bearer {token}" },
|
||||
{ "IntezmenyId", $"{intezmenyGuid}" },
|
||||
{ "OktatasiAzonosito", $"{oktatasiAzonosito}" },
|
||||
{ "IDPEgyediazonosito", $"{idpEgyediazonosito}" }
|
||||
};
|
||||
|
||||
public static Dictionary<string, string> GetAuthorizationHeaderWithJson(this string token)
|
||||
=> new Dictionary<string, string>
|
||||
{
|
||||
{ "Content-Type", "application/json" },
|
||||
{ "Authorization", $"Bearer {token}" } };
|
||||
|
||||
public static Dictionary<string, string> GetFormUrlEncodedHeader()
|
||||
=> new Dictionary<string, string>
|
||||
{
|
||||
{ "Content-Type", "application/x-www-form-urlencoded" },
|
||||
};
|
||||
|
||||
public static Dictionary<string, string> GetEszkozQueryString(this string intezmenyAzonosito, string sztsz)
|
||||
=> new Dictionary<string, string>
|
||||
{
|
||||
{ "intezmenyAzonosito", $"{intezmenyAzonosito}" },
|
||||
{ "sztsz", $"{sztsz}" }
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue