If your current API project is not your identity API then using POSTMAN to access it through an existing deployment (for example on your local IIS) of your identity service is an alternative. The fourth task involves generating the JWT token.Įntering the credentials to your data will give the desired token: When we re-build and run our API application the Swagger methods will show as follows: ![]() New ) Ĭ.AddSecurityDefinition("Bearer", new ApiKeyScheme()ĭescription = "Please enter into field the word 'Bearer' following by space and JWT", Public void ConfigureServices(IServiceCollection services) Use this method to add services to the container. This method gets called by the runtime. This is done as follows in our Startup.cs: ![]() Public IActionResult Token(UserViewModel userDto)įor the second task, we implement code to enable Swagger API definitions to be generated for our Web API. Public class UsersController : Controller
0 Comments
Leave a Reply. |