Exemple #1
0
 /// <summary>
 /// Подписывает запрос (или вычисляет client_secret запроса).
 /// </summary>
 internal static string SignData(IEsiaSigner esiaSigner, EsiaOptions options, string scope, string timestamp, string clientId, string state)
 {
     byte[] signData = Encoding.UTF8.GetBytes(scope + timestamp + clientId + state);
     return((esiaSigner != null)
         ? esiaSigner.Sign(signData)
         : throw new ArgumentNullException("Need to define IEsiaSigner"));
 }
Exemple #2
0
 /// <param name="esiaOptions">Свойства подключения к ЕСИА.</param>
 /// <param name="esiaEnvironment">Среда ЕСИА.</param>
 /// <param name="serviceProvider">Поставщик служб (сейчас используется для получения IEsiaSigner).</param>
 public EsiaEvents(
     EsiaOptions esiaOptions,
     IEsiaEnvironment esiaEnvironment,
     IServiceProvider serviceProvider) // TODO add IEsiaSigner directly
 {
     this.EsiaOptions     = esiaOptions;
     this.EsiaEnvironment = esiaEnvironment;
     this.EsiaSigner      = serviceProvider.GetService <IEsiaSigner>(); // TODO add IEsiaSigner directly
 }
Exemple #3
0
 public EsiaRestService(
     IHttpContextAccessor httpContextAccessor,
     IEsiaEnvironment esiaEnvironment,
     IServiceProvider serviceProvider, // TODO add IEsiaSigner directly
     IOptionsMonitor <OpenIdConnectOptions> optionsMonitor,
     EsiaOptions esiaOptions)
 {
     this.context         = httpContextAccessor.HttpContext;
     this.esiaEnvironment = esiaEnvironment;
     this.esiaSigner      = serviceProvider.GetService <IEsiaSigner>(); // TODO add IEsiaSigner directly
     this.optionsMonitor  = optionsMonitor;
     this.esiaOptions     = esiaOptions;
 }
 public EsiaHandler(
     IOptionsMonitor <OpenIdConnectOptions> options,
     ILoggerFactory logger,
     HtmlEncoder htmlEncoder,
     UrlEncoder encoder,
     ISystemClock clock,
     EsiaOptions esiaOptions,
     IEsiaEnvironment esiaEnvironment)
     : base(options, logger, htmlEncoder, encoder, clock)
 {
     this.esiaOptions     = esiaOptions;
     this.esiaEnvironment = esiaEnvironment;
 }
Exemple #5
0
 public OpenIdConnectOptionsBuilder(EsiaOptions esiaOptions, IEsiaEnvironment environment)
 {
     this.esiaOptions = esiaOptions;
     this.environment = environment;
 }