Securely calling a WebSite hosted Web API from an Azure WebJob -


I have constantly been monitoring the scheduled web job message queue, dragging the messages and the Web to peer web site The API is calling to process the messages (in this case using Signal R to send notification to the appropriate users)

What would be the best way to securely call the web APIs in this case? The API being hosted on the web site is obviously otherwise revealed. Perhaps using some basic ath or to store a security token in the config and pass it on to the web API from the job. Or building custom authoritative attribution?

Brain ideas will be appreciated on WebAb for secure web API calls.

Update: Maybe something like this?

Firstly I declare this class;

  public class TokenAuthenticationHeaderValue: AuthenticationHeaderValue {public TokenAuthenticationHeaderValue (string token): base ( "token", Convert.ToBase64String (Encoding.UTF8.GetBytes (token))) {}}  

  using (var client = new HttpClient ()) {client.BaseAddress = new Uri (;> then the caller (WebJob) when HTTP requests an authentication Uses this class to set the header / * something * /); Client.DefaultRequestHeaders.Accept.Clear (); Client.DefaultRequestHeaders.Accept.Add (New MediaTypeWithQualityHeaderValue ("App / Jason")); Client.DefaultRequestHeaders.Authorization = New tokenAdministrationsHeaderWell ("Tokens from Confidential"); In Web API we request for the expected token in the athlete, currently this code is very ugly but it can be put in a custom attribute;  
  Public HTTPPRESS PacesMessage Post ([CBD] The Typing Message) {var authentication header = request. Header. Authorization; Var Token = Encoding. UTF8.GetString (Convert.Fababase 64 String (Authentication Header. Permat)); If (! AuthenticationHeader.Scheme = "token" || tokens { ") token =" config back Request.CreateErrorResponse (HttpStatusCode.Unauthorized, "No, no, not that naughty."); } // All is OK, continue  

Thus Vebojk peer Web site calls the Web API and security is maintained in the gain from a token Azure configuration safely, both on site and jobs Access is this token.

Any better ideas?

Looks like the original certification is good for your scenario.

Great tutorial here:


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -