Fantastic ! Thank you very much @Alper, you're great :)
Hi, no I've tested this on v5.1.0. Bug fix is planned for v5.4.0 release.
No, I don't think that external auth will help here.
The problem is the format of the POST request sent to <a class="postlink" href="https://exampleurl.com/api/TokenAuth/Authenticate">https://exampleurl.com/api/TokenAuth/Authenticate</a>
I've tested this with postman :
See attached screenshots.
The question is : can we have both formats JSON and Text (plain/text) supported for authentication ?
Hi,
I've an external web client that needs to connect to my aspnetcore server. The problem is that authentication request cames with a plain text format instead of json. The result is an HTTP 415 error.
Is it possible to configure authentication aspboilerplate server to accept plain text format as well ?
yes
I dug a little bit more on this issue and found the problem. In method GetTenantLogo, the URL that is set for defaultLogo is wrong : you should add "/Assets" to the URL.
var defaultLogo = "/Assets/Common/Images/app-logo-on-" + skin + ".png";
Hi,
I've done some updates on my project. For the Kestrel BadHttpRequestException, I simply update nuget packages (including aspnetcore kestrel). No more exceptions of this kind in LOG file.
For the Microsoft.AspNetCore.AzureAppServices.HostingStartup, I've applied the workaround explained here [https://github.com/aspnet/Hosting/issues/1246]) but I still have same exception :
FATAL 2018-04-04 08:16:14,306 [6 ] soft.AspNetCore.Hosting.Internal.WebHost - Hosting startup assembly exception
System.InvalidOperationException: Startup assembly Microsoft.AspNetCore.AzureKeyVault.HostingStartup failed to execute. See the inner exception for more details. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.AzureKeyVault.HostingStartup' or one of its dependencies. The system cannot find the file specified.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)
--- End of inner exception stack trace ---
This is not a blocking error and is not visible by users. But it is still better to have no errors at all ;)
Hi,
I'm running my app over Azure. Sometimes, I'm getting a server error popup message when connecting to a tenant or on first host connection. Looking at logs, I've remarked two exceptions that are fired very often (each time server starts at least). Here they are
FATAL 2018-03-26 07:01:03,366 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Hosting startup assembly exception
System.InvalidOperationException: Startup assembly Microsoft.AspNetCore.AzureAppServices.HostingStartup failed to execute. See the inner exception for more details. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.AzureAppServices.HostingStartup' or one of its dependencies. The system cannot find the file specified.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)
--- End of inner exception stack trace ---
INFO 2018-03-26 07:15:09,011 [14 ] Microsoft.AspNetCore.Server.Kestrel - Connection id "0HLCISULQQUV1" bad request data: "Invalid request line: '415e-aa28-7c00bb172254\x0D\x0A'"
Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Invalid request line: '415e-aa28-7c00bb172254\x0D\x0A'
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser`1.GetUnknownMethod(Byte* data, Int32 length, Int32& methodLength)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser`1.ParseRequestLine(TRequestHandler handler, Byte* data, Int32 length)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser`1.ParseRequestLine(TRequestHandler handler, ReadableBuffer buffer, ReadCursor& consumed, ReadCursor& examined)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame.TakeStartLine(ReadableBuffer buffer, ReadCursor& consumed, ReadCursor& examined)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame.ParseRequest(ReadableBuffer buffer, ReadCursor& consumed, ReadCursor& examined)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame`1.<ProcessRequestsAsync>d__2.MoveNext()
I've googled exception BadHttpRequestException. Both exceptions seems to be linked with System.IO
Do you know how to fix this ?
Hi,
I would like my users to be able to add entities attributes themselves from UI. It's a common scenario for a professional application and I would appreciate your advice to start implementation.
Basicaly, the user should be able to go in some application settings, and add a property name, a property type and a target entity. As a result, when the user will open an entity (let's say a Product entity) then he will have new attributes displayed.
I have two main ideas in mind :
SOLUTION 1 : create a specific entity, let's say AdditionalAttributes (to store property names and types). Then I will add a ICollection<AdditionalAttributes> to a set of existing entities (the ones I want users to be able to extend). I know how to do this in ASPNETZERO context from domain layer to presentation layer. Don't know if this will lead to performance issues or whatever bad.
SOLUTION 2 : adding an XML property to each entities to extend. I don't have much experience on this approach and don't know how to implement this on UI side at least. See here : [https://stackoverflow.com/questions/30783224/dynamically-adding-a-property-to-an-entity-framework-object])
Do you have other solutions in mind ? What's your advice as ASPNETZERO experts ?