Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagec#
app.UseKodiakTokenValidation(
    "-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMI...", 
    "https://kodiak.is", 
    "https://kodiak.is", 
    "RequestForQuoteService", 
    "Server=kodi-mssql;Initial Catalog=CATALOG;User Id=user;Password=pass;", 
    "SqlServer"
  );

Example request to service using the Token Authenticator

Code Block
wc.Headers[HttpRequestHeader.ContentType] = "application/json";
wc.Headers[HttpRequestHeader.Authorization] = "Bearer " + Kodi.Kodiak.Client.Settings.Context.KodiakServiceToken;
var response = await wc.UploadStringTaskAsync(Kodi.Kodiak.Client.Settings.Context.QuoteServerUrl + "api/quotes", json);
CreateQuoteResponse createQuoteResponse = JsonConvert.DeserializeObject<CreateQuoteResponse>(response);