Strikethru in Trello

Yes, Trello is great. Actually its flippin awesome and has pretty much changed the way I work and the tools I used to use.

Unfortunately Trello doesn’t fully support markdown, but does allow you to strikethru in certain areas which is a nice feature which seems to be very hidden.

Simply:-

~~yourdata~~

This doesn’t work on List names but does work within them, in checklists, cards and so on.

OAuth Facebook, Twitter, LinkedIn, Instagram and more with WebApi and Identity 2

The Identity 2 system includes OAuth connections for Facebook, Twitter and Google. These are easy enough to configure (well to do a simple register/login) from an MVC website project BUT doing this with Web Api needs a little more knowledge!

Firstly I’ll make reference to this excellent resource on configuring various OAuth providers.

http://www.beabigrockstar.com/guides/aspnet-oauth

So if you’ve followed this correctly you should have your API key/secret in your Startup.Auth file.

http://stackoverflow.com/questions/21065648/asp-net-web-api-2-how-to-login-with-external-authentication-services

Now to use this with WebApi you need to make a call to

GET /api/Account/ExternalLogins?returnUrl=%2F&generateState=true

This will return an object of all your registered OAuth providers along with a URL.

Make a GET request to this URL and you will be redirected to the providers login page which will eventually request the permissions you are needing for your app.  (Typically this will be your client website or native app making this call)

e.g.

http://localhost:2000/api/Account/ExternalLogin?provider=Facebook&response_type=token&client_id=self&redirect_uri=http%3A%2F%2Flocalhost%3A30756%2F&state=YRN-9tp3XCn_PUmp6yMBHX896rRu_UOkA9xxxxxxxxx

Once authenticated, you will go back to your callback URL, which will look something like this or back to your native app.

http://localhost:30756/#access_token=SOMETOKENVALUE&token_type=bearer&expires_in=1209600&state=SOMESTATEVALUE

Notice the access_token and token_type values.  So all we need to do now to parse this response and send an Authorized request to our protected Api controller using this token.

e.g.

localhost:30756/api/account/userinfo

or

curl -H "Authorization: OAuth <ACCESS_TOKEN>" http://www.example.com