Questions
Let's answer the following questions to practice what we have learned in this chapter:
- In the
Configure
method in theStartup
class, 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-app
in 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...