Friday, December 28, 2012

Authentication with Office 365 from an On-Premise Application

Recently I had a problem wherein I needed to connect to an Office 365 SharePoint site from an on Premise Windows App.
Now at first it seemed simple but as I drilled deeper I came across some challenges and while overcoming them I learned a lot more about how O365 Authentication works.

Before I go further I would like to point out 2 resources which helped me a lot in solving this challenge:
Here is that diagram which explains the AuthN basics for SharePoint Online in Office 365:
Passive claims AuthN 
(So the key here is to understand that SharePoint Online uses the binary token returned from the STS service located at to validate all requests.)

At first I tried using the “MsOnlineClaimsHelper” but I couldn’t get it to work as it kept on throwing errors while fetching the response using ‘WSTrustFeb2005ContractClient’. Then I looked at the WinRT code and it was doing the exact same thing but with much less dependencies. Just plain HttPWebRequests + XML.

But the WinRT code was specifically for REST API’s and not Client Object Model. So I modified the code a little bit to make it work with CSOM.

Here is the link to Helper class code that I created and used for one of the code samples on MSDN.

Programmer Anarchy

I came across this refreshing ‘Post Agile Process’ video which revitalizes my earlier email on Test is Dead.

Here are some key takeaways for me out of this talk:

  • No need for testing infrastructure.
    (This is a culture shift and a revolutionary way to solve a lot of problems existing in the software world)

  • Break software into smaller more independent pieces.

  • Experimentation drives Innovation. (Move fast break things)

  • 2 key qualities for surviving in the ‘Modern Developer’ role:
    • Self-Leaner
    • Likes to Deliver (“Perfect” is the enemy of “Good Enough”)

  • At times, think of Software development as Manufacturing rather than Engineering.
    (Being a geek, it was a bit mind boggling for me to hear this first but I get the point)

What are your thoughts ?

Test is Dead !!!!

A refreshing way to present a very important point :  Test is Dead

Some moments from the video :