wcf Authentication Token Implementation - How to do

巧了我就是萌 提交于 2019-12-11 02:26:29

问题


I need to implement token authentication between the user of my wcf services and my server.

1- User will request a token with his username, nickname and password from server and server will respond with a token if the credentials are correct?

Question For 1

  • Should I create token for every single request or can I make it some storage to use the same token for specific period of time. What is the best way of doing that? any example on the web for this implementation?
  • After token creation, where should I store the token? inside a database table or inside the memory? or any other way?
  • What should I return if the credentials are wrong?
  • how can I prevent the user from sending so many token requests in a short period of time?

2- Then user will use that token to use my service.

Question For 2

  • how the client can pass the token to server? along with the query string? what is the best approach of doing that?

Any example or suggestion would be great.


回答1:


you can pass the token in the request header.

take a look at Oauth



来源:https://stackoverflow.com/questions/6798892/wcf-authentication-token-implementation-how-to-do

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!