DotNetOpenAuth.WebAPI.40

485 views
Skip to first unread message

David Christiansen

unread,
Jul 13, 2012, 11:18:06 PM7/13/12
to dotnet...@googlegroups.com
Hey all,
Just a quick note before I retire for the morning (it being 4am and all) . I've just completed my first pass at a sample for using DotNetOpenAuth with ASP.NET WebAPI. It currently consists of a sample JavaScript and C# client and a host serving both authorisation and resource server roles.

I have pushed out my work so far and as always really welcome your feedback;


Note: It is still rough and should not be considered suitable for inclusion in production code.
 
Regards,
DC

Steven Livingstone Pérez

unread,
Jul 14, 2012, 6:27:08 AM7/14/12
to dotnet...@googlegroups.com
Lovely work David!

I actually asked Scott Hanselman about this last night at his talk - i'd like to see it made really easy to create a new project with oAuth as a simple checkbox.

I think we should try and push this on towards a production level template/pattern over time. I'm working on oAuth/API stuff on Tuesday so i'll get a good look then!

cheers,
steven


Date: Fri, 13 Jul 2012 20:18:06 -0700
From: da...@davidchristiansen.com
To: dotnet...@googlegroups.com
Subject: [dotnetopenauth] DotNetOpenAuth.WebAPI.40
--
You received this message because you are subscribed to the Google Groups "DotNetOpenAuth" group.
To view this discussion on the web visit https://groups.google.com/d/msg/dotnetopenid/-/g14QJVxZMsoJ.
To post to this group, send email to dotnet...@googlegroups.com.
To unsubscribe from this group, send email to dotnetopenid...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dotnetopenid?hl=en.

Ryan Rousseau

unread,
Jul 14, 2012, 8:55:31 AM7/14/12
to dotnet...@googlegroups.com
Very cool! I've recently implemented DNOA to authorize WebAPI calls, but that was the extent of my usage (so far).

Steven Livingstone Pérez

unread,
Jul 19, 2012, 12:13:01 PM7/19/12
to dotnet...@googlegroups.com, da...@davidchristiansen.com
David - been looking at this for a wee while today.

I'm currently looking to create a console app that makes a call to the api. I had figured that once i went through the oAuth dance on either the client or server oAuth web examples you have, I could grab the oAuth token and put that into a "Bearer" auth header in a request *on my console app* and the request would go through. However, i'm getting various exceptions from DotNetOpenAuth (mainly to do with unexpected buffer sizes etc). I may be missing something (most likely).

What would i need to do on top of your code to grab the oAuth token generated when i click the button on your "ASP.NET WebAPI Client Application Sample" sample web page and put that into a console app? I didn't think there would be much more than putting the same token into an auth header but it seems there is ...

Still debugging through it all though :-)

cheers,
steven


Date: Fri, 13 Jul 2012 20:18:06 -0700
From: da...@davidchristiansen.com
To: dotnet...@googlegroups.com
Subject: [dotnetopenauth] DotNetOpenAuth.WebAPI.40

Steven Livingstone Pérez

unread,
Jul 19, 2012, 12:32:52 PM7/19/12
to dotnet...@googlegroups.com, da...@davidchristiansen.com
Sods law dictates i got this working exactly as i expected it to minutes after i posted it to the planet. Turns out the it was a clock difference and as the tokens auth tokens have a two minute lifetime i was getting odd exceptions once they expired.

Just need to look at how to refresh them in the console now...


From: web...@hotmail.com
To: dotnet...@googlegroups.com
CC: da...@davidchristiansen.com
Subject: RE: [dotnetopenauth] DotNetOpenAuth.WebAPI.40
Date: Thu, 19 Jul 2012 16:13:01 +0000

David Christiansen

unread,
Jul 19, 2012, 2:03:27 PM7/19/12
to Steven Livingstone Pérez, dotnet...@googlegroups.com
Glad I could help ;)
--

DCCreativeLogo.gif

<David.Christiansen/>

davidchristiansen.com

skype: davidchristiansen

sharpsts.codeplex.com :: dotnetopenauth.net :: dccreativedesign.co.uk


image001.jpg

Andrew Arnott

unread,
Jul 19, 2012, 3:16:59 PM7/19/12
to dotnet...@googlegroups.com, Steven Livingstone Pérez
Can your console app reference DNOA?  If so, you can carry the client secret and refresh token over to the console app and DNOA can handle all the token refresh logic for you.
To unsubscribe from this group, send email to dotnetopenid+unsubscribe@

DCCreativeLogo.gif

<David.Christiansen/>

davidchristiansen.com

skype: davidchristiansen

sharpsts.codeplex.com :: dotnetopenauth.net :: dccreativedesign.co.uk


--
You received this message because you are subscribed to the Google Groups "DotNetOpenAuth" group.
To post to this group, send email to dotnet...@googlegroups.com.
To unsubscribe from this group, send email to dotnetopenid...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dotnetopenid?hl=en.


--
--
Andrew Arnott
"I [may] not agree with what you have to say, but I'll defend to the death your right to say it." - S. G. Tallentyre
image001.jpg
Reply all
Reply to author
Forward
0 new messages