-1

I'm using dotnetopenauth 3.4.7.11121. I need to generate an access token for an application(it will supply its id and secret), not for a user, somenthing like what Facebook does. Is it possible using 3.4.7.11121?

I guess I need somenthing like this scenario

Community
  • 1
  • 1
Crixo
  • 3,060
  • 1
  • 24
  • 32
  • Please specify what kind of access token you want to generate, and who will consume it. – Andrew Arnott Dec 02 '12 at 23:58
  • I need to generate an accessToken that will be used by an application to authenticate itself on a web api. I made it working using _serviceProvider.PrepareAccessTokenMessage(AuthorizedTokenRequest) creating AuthorizedTokenRequest via reflection and usin reflection as well read TokenSecret from authorizedTokenResponse. That application is alredy using OAuth, so owns a cosnumerKey and Secret, to acces api as per regular oauth scenario involving user as well. Same app needs to access other api not related to any user and I'd like to use oauth for those apis as well. – Crixo Dec 03 '12 at 08:06
  • I understand that's not a "pure" OAuth utilization, but that avoid to force an app to use 2 different type of authentication. AccessToken usually is related to app+user, that special one is related only to the app and it will allow the app to access a set of api restricted to other apps. – Crixo Dec 03 '12 at 08:30
  • So... we're talking about OAuth 1.0 here, apparently? – Andrew Arnott Dec 04 '12 at 04:52

1 Answers1

0

It sounds like you're talking about OAuth 1.0. Based on that assumption...

Just come up with an access token and token secret yourself, store it in your OAuth 1.0 service provider's token database, and give it to your OAuth 1.0 consumer. When the call to service provider comes in, DNOA will validate the token against your access token database and it will show up as valid.

In other words, if you want a non-standard way of issuing OAuth 1.0 access tokens, just do it yourself -- not need to use DotNetOpenAuth for generating the access token as it is just a series of random characters stored in a database table.

Andrew Arnott
  • 80,040
  • 26
  • 132
  • 171