How to configure OAuth Bearer authentication in a self hosted Katana/WenAPI 2 application

Jun 14, 2014 at 6:39 PM
Edited Jun 14, 2014 at 6:40 PM
I'm at the beginning of writing my first Katana application.
My application will be serving WebAPI 2, and the only type of client it expects is Angular SPA.
I'm planning on self hosting my application in a Windows server process using Topshelf.
This is what I'm planning on accomplishing my two main goals:
1) To serve a cross-domain JavaScript SPA, using OAuth2 token bearer flow
2) To use the same application to implement long-running services, like data loads, analysis, etc...

I'm struggling with adding OAuth2 token generation and consumption parts. I've looked at a number of working samples, but they all are of Web app type, while I'm interested in a self-host.
Are there any examples of how a self-hosted Katana application implements OAuth2 authentication?