Questions
Let's answer the following questions to practice what we have learned in this chapter:
- In the
Configuremethod in theStartupclass, what is wrong with the following?public void Configure(...) { ... app.UseEndpoints(...); app.UseAuthentication(); } - What attribute can be added to a protected action method to allow unauthenticated users to access it?
- We are building an app with an ASP.NET backend and using an identity provider to authenticate users. The default audience has been set to
http://my-appin the identity provider, and we have configured the authentication service in our ASP.NET backend as follows:services.AddAuthentication(options => { options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme...