c# - Web API token authentication with a custom user database -
i developing web api 2.1 service needs authenticate connecting clients (html5/js clients create , control). unfortunately, user info (username, password hashes, roles , much, much more info) stored in existing (sql server) database have read access. users database table created 5-6 years ago without reference security frameworks, it's custom format. i'm not allowed create changes either info or database structure.
inspired this article, rolled own token-based method of authenticating users, i'm lacking completeness , (re)assurance of using established security framework.
is there way integrate existing framework, e.g. oauth2, within current project given constraints mentioned above? don't know if makes difference, i'm self-hosting using owin.
edit: don't know why couple of people downvoted question - bad? it's genuine question far i'm concerned, , love have reply (even if it's "no, can't because..."). if people can explain reasons in comment, that'd appreciated.
this reply similar question. says:
make custom user class implementsiuser
define custom user store implements public class userstoreservice : iuserstore<customuser>, iuserpasswordstore<customuser>
wire up since reply pretty extensive provided basic steps... details here: how customize authentication own set of tables in asp.net web api 2?
this valuable content applies web api:
customizing asp.net authentication identity jumpstart
https://www.youtube.com/watch?v=uhfead2lqyw here version of link (since link reported dead): https://www.youtube.com/watch?v=zktseyrwr4o
hth
c# asp.net authentication asp.net-web-api web-api
No comments:
Post a Comment