The TokenRequestViewModel

Let's start adding the former one, that contains the parameters that will come from the client when trying to authenticate itself. From Solution Explorer, right-click on the /ViewModels/ folder and add a new TokenRequestViewModel.cs file with the following content:

using Newtonsoft.Json;namespace TestMakerFreeWebApp.ViewModels{    [JsonObject(MemberSerialization.OptOut)]    public class TokenRequestViewModel    {        #region Constructor        public TokenRequestViewModel()        {        }        #endregion        #region Properties        public string grant_type { get; set; }        public string client_id { get; set; }        public string client_secret { get; set; }        public string username { get; set; }        public string password { get; set; }        #endregion    }}

Get ASP.NET Core 2 and Angular 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.