Blazing Heart Reader is architected so the back-end data is available through ASP.NET Web APIs, and the web front end just uses javascript (with the help of jQuery) to consume them. This allows the data to be accessed from future applications, such as desktop or mobile apps, directly. That is, if they are autenticated - which turned out to not be possible through anything other than the web page with the way things were.

But, over the last few nights I have been working to add support for HTTP Basic Authentication, which is where your user name and password are send to the server as part of the connection process. This allows using code to access the API by passing a user name and password as part of it's connection process. I have a simple WPF test app that I made which uses RESTSharp to connect to the Blazing Heart Reader API, which now works:

To get this working, I coppied the code for IdentityBasicAuthenticationAttribute.cs and related files, and then just added the attribute to the API controllers:

Easy. Behind the scenes though, this is only possible because I'm using the Owin authentication model which bypasses the server authentication. This is important because the server only allows one type of authentication for the whole application but Owin allows you to use anything you write a filter for. It's a good thing I previously upgraded the site to ASP.NET MVC 4 to use Owin otherwise this would have been quite painful!

4 Comments

  • Rena said

    I visited various web pages but the audio feature for audio songs existing at this site is in fact superb.

  • www.juegosdemariobros.tv said

    Quality stuff, going to link on my facebook. Unrelated, but anyone suffering from diabetic complications here?
    If so, check out this great treatment guide I found.

  • retail training said

    My brother suggested I might like this web site. He was totally
    right. This post actually made my day. You can not imagine simply how much time I had spent for this info!
    Thanks!

  • home based business said

    Hey would you mind stating which blog platform you're working with?
    I'm going to start my own blog in the near future
    but I'm having a tough time deciding between BlogEngine/Wordpress/B2evolution and Drupal.

    The reason I ask is because your design and style seems different then most blogs and I'm
    looking for something completely unique.
    P.S My apologies for getting off-topic but I had to
    ask!

Add a Comment