简体   繁体   中英

Create Access Token using Dotnet Open Auth

I have a website which contains lot of user informations. I want to share those with client website through proper authentication. As I am going to develop this api using asp.net mvc 4, I selected DotnetOauth for providing authentication. If a website want to access my data from website, they have to register with my developer website, after the registration that website will generate Consumer key and Secret Key . After the registration, for each api request the client will pass these keys. Up to this is done.

Using this Consumer Key and Secret Key, client will send api request and if the valid token is not available in the request, it will redirect to login page. After the successful login, a token will generate and client can use this token for furthor request up to the expiry.

Anybody have idea about creating token based on Consumer Key and Secret Key with the help of DotnetOauth . Iam using Asp.net MVC

Thanks

In order to create an access token using DNOA, you should implement the interface IAuthorizationServerHost. The method CreateAccessToken is the responsible of creating the token.

I recommend you to download DotNetOpenAuth samples, and have a look to 'OAuthAuthorizationServer' project.

Hope this help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM