by Stever B
25. May 2010 17:03
Now that we have a clue about calling an OAuth secured service using Javascript, let’s try it again with C#. That way we can do the calling from the server side and not have to worry about exposing our secret key to the browser. This example is using the OAuth libray found at: http://oauth.googlecode.com/svn/code/csharp/OAuthBase.cs. More...
by Stever B
13. March 2010 17:48
We’ve been working on implementing some sort of enterprise wide single sign-on (SSO) at work. As part of that we really needed some way to authenticate with web services without depending on Windows or Basic Authentication, which is a phenomenal pain in the butt.
Enter OAuth
OAuth is “An open protocol to allow secure API authorization in a simple and standard method from desktop and web applications.” In other words, you can authenticate with it from lots of different places. More...
by Stever B
12. February 2010 09:31
Recently I had the need to let a user upload a zip file and then have the Ruby app extract it and store it in a DB. I turned to google, but beyond some posts recommending using rubyzip to do the zip file handling I couldn't find anything showing a good way to do this recursively without first actually extracting the zip file to disk and then using the dir object.
After much adding and deleting code I have something that works reasonably well. More...
by Stever B
9. November 2009 01:57
I've recently begun learning Ruby by working my way through the Ruby Koans. I finally made it to the section on error handling, which answered a few questions for me.
Once again, Ruby has not surprised me (this is a good thing). There's just some minor syntactical differences. Specifically in place of "try, catch, finally" Ruby uses "begin, rescue, ensure".
begin
fail "Oops"
rescue StandardError => ex
#Do something with the error
ensure
result = :code_that_always_runs
end
Since I haven't made it all the way through the koans yet I'm, probably missing something that seems obvious to long time Ruby users, but so far it's pretty damned simple.
by Stever B
24. November 2008 17:39
Behaviors in WCF are so stinking useful, and once you get past the basics of WCF they're arguably a necessity. Microsoft has saved itself from hundreds of hours of cursing by including the ability to define custom behaviors.
My favorite use of behaviors is addressing some cross cutting concerns that we consistently have in our WCF services. Specifically logging, service registration, wsdl tweaking, and error handling. Which brings us around to the IErrorHandler interface.
More...