Sustainsys / Saml2

Saml2 Authentication services for ASP.NET
Other
959 stars 602 forks source link

Metadata not available for ASP.NET Core 2.0 implementation #815

Closed EricSpeidel closed 6 years ago

EricSpeidel commented 7 years ago

In order to register my SP with my IDP, I have to supply them with Metadata describing my SP. This used to be available at ~/AuthServices, and should now be available at ~/Saml2 as @AndersAbel mentioned. However, accessing this will throw the following exception:

System.InvalidOperationException occurred HResult=0x80131509 Message=Incorrect Content-Type: Source=Microsoft.AspNetCore.Http StackTrace: at Microsoft.AspNetCore.Http.Features.FormFeature.ReadForm() at Microsoft.AspNetCore.Http.Internal.DefaultHttpRequest.get_Form() at Sustainsys.Saml2.AspNetCore2.HttpRequestExtensions.ToHttpRequestData(HttpContext httpContext, Func 2 cookieDecryptor) in C:\Users\EricSpeidel\source\repos\Saml2-master (3)\Saml2-master\Sustainsys.Saml2.AspNetCore2\HttpRequestExtensions.cs:line 28 at Sustainsys.Saml2.AspNetCore2.Saml2Handler.HandleRequestAsync() in C:\Users\EricSpeidel\source\repos\Saml2-master (3)\Saml2-master\Sustainsys.Saml2.AspNetCore2\Saml2Handler.cs:line 109 at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.<Invoke>d__6.MoveNext() How to reproduce: Build the latest version and run the .NET Core sample application. Accessing https://localhost:44342/Saml2 will throw the exception.

EricSpeidel commented 7 years ago

Tested with Chrome and Edge. Same outcome.

gauravthakur25 commented 6 years ago

Hi,

Is this issue fixed? I am still not able to get metadata from ~/Saml2. If there's any other url to get metadata, kindly let me know.

Regards, Gaurav

AndersAbel commented 6 years ago

@gauravthakur25 What version are you running?

gauravthakur25 commented 6 years ago

Sustainsys.Saml2.AspNetCore2 2.0.0--preview01 I need to make it work for ASP.NET core

AndersAbel commented 6 years ago

There is no metadata support if you target .NET Core with that package. If possible, target the full framework and use the 0.24.0 package.

gauravthakur25 commented 6 years ago

We have to deploy our application on Linux servers, hence can't use full framework. Can you suggest any other workaround or possible date for the fix.

AndersAbel commented 6 years ago

@gauravthakur25 If you need to ensure that this is done, please mail me at anders@sustainsys.com to discuss commercial options. For work done for free, I cannot promise any fix date.

gauravthakur25 commented 6 years ago

Thanks @AndersAbel will drop you a mail.