![]() Now move to the Configure method of your startup.cs. Also notice that our AuthorizationUrl is using our previous configuration that we set up to get. It’s somewhat beyond the scope of this article to really get into the nitty gritty of what each of these properties do, but this is the correct setup for Auth0. What we are really adding is that SecurityDefinition. The full code looks like so : services.AddSwaggerGen(c =>Ĭ.AddSecurityDefinition("Bearer", new OpenApiSecuritySchemeĪuthorizationUrl = new Uri(Configuration + "authorize?audience=" + Configuration) At a high level, it’s telling Swagger that “Hey, you need a token to call this API, here’s how to get one”. What this does is define how our API is authenticated, and how Swagger can authorize itself to make API calls. What we need to do is add a SecurityDefinition to Swagger. In our startup.cs file, and inside the ConfigureServices method, we will have something similar to “AddSwaggerGen”.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |