I'm using [AbpAuthorize] with methods, so I'm not able to call methods from Swagger API. The reason is simple that user is not logged in, so Do we have any way to send login credentials from Swagger UI?
Or Do we have any way to have configurable [AbpAuthorize] based on some flag? So that for my development environment I can disable [AbpAuthorize] and in the live environment, I will enable [AbpAuthorize].
5 Answer(s)
-
0
Hi @ManojReddy,
We haven't integrated it into AspNet Zero but you can use <a class="postlink" href="https://github.com/aspnetboilerplate/module-zero-core-template/pull/108">https://github.com/aspnetboilerplate/mo ... e/pull/108</a>.
-
0
Thanks for your reply, it works perfectly.
I'm not able to get the key (allowSwaggerToRunAPIs ) value from the app.config file in Startup.cs file. I want to make this as configurable.
<configuration> <appSettings> <add key="owin:AutomaticAppStartup" value="false"/> <add key="allowSwaggerToRunAPIs" value="true"/> </appSettings> <runtime> <gcServer enabled="true"/> </runtime> </configuration>
-
0
Put that in appsettings.json:
"App": { "AllowSwaggerToRunAPIs": "true" }
And get it in Startup.cs:
if (bool.Parse(_appConfiguration["App:AllowSwaggerToRunAPIs"])) { // ... }
-
0
Link appsettings.json is giving 404. [https://github.com/aspnetzero/aspnet-zero-core/blob/67b8cdd1542e2cdfef982b08a886df2f6c7c1e56/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Host/appsettings.json#L13])
-
0
You need to login with your GitHub account to access the private repo. You can invite yourself here: <a class="postlink" href="https://aspnetzero.com/LicenseManagement">https://aspnetzero.com/LicenseManagement</a>