Using the Authenticated User When Posting Questions and Answers

Learn how to ensure that only authenticated users can post questions and answers.

Now that our REST API knows about the user interacting with it, we can use this to post the correct user against questions and answers.

Steps to authenticate users for posting questions and answers

Let's carry out the following steps:

  1. We'll start by adding the following using statements in QuestionsController.cs:

Get hands-on with 1200+ tech skills courses.