icon

CodeTrigger   Forum

Code Generation For C#, WPF, WCF, SQL SERVER/ORACLE/MYSQL and Visual Studio 2013-2017

HomeGeneral

General Discussion Board - Please post questions, answers, (polite) opinions, and use-cases. Moderators reserve the right to amend the text/subject line or re-categorise the post to better suit the forum configuration if necessary.

Security on the WebApi Messages in this topic - RSS

migrator
03/12/2017
migrator
Administrator
Posts: 63
migrator
migrator
Administrator
Posts: 63
Hello, how do you enable security on the WebAPI so the use has to be logged in before accessing the data?
edited by migrator on 12/3/2017
0 link
03/12/2017 migrator
Administrator
Posts: 63
migrator
migrator
Administrator
Posts: 63
Security on the Api is managed using Asp.Net Identity. This wizard option "Use Asp.net Identity" has to be selected when the wizard is first used to create the project. It will then generate .net identity tables if required in the db, as well as security code and the required attributes on the Api functions. It cannot be retrofitted if not selected at wizard creation time.
For an example of security on the API, create an MVC app using the wizard and select the identity option. You will then be required to login to the app, and the API is configured to require authentication.
0 link