This project is read-only.

Attribute 'localpath' not recognized when calling Login.ashx page

May 7, 2015 at 1:45 PM
Edited May 11, 2015 at 1:48 PM

I'm beginning a new ASP.Net/C# project where I need to configure the SP metadata for a SAMLv2 IDP. I'm having the two troubles:
  • Several messages like : Could not find schema information for the element 'X', where X can be saml2, serviceProvider, localpath, ... (all that's in the <saml2> section of the Web.config file)
  • When I launch my application, I go to a page __http://localhost:9311/__, witch loads the ASP.NET presentation page. If I try to enter the address __http://localhost:9311/Login.ashx__, or __http://localhost:9311/Metadata.ashx__ to test the application endpoints, I have the following error message in my browser : Attribute 'localpath' not recognized. This message points to the first Web.config <endpoint> tag:
<endpoint localpath="Login.ashx" type="signon" redirectUrl="~/AuthenticatedHomePage" />
Do you think the error is related to the Web.config messages? How can I proceed in order to solve this?

Thanks in advance for your help,
May 11, 2015 at 1:35 PM
Edited May 15, 2015 at 8:55 AM
Hi again.

Sorry for the double post, but I decided to post my Web.config file, it may help to see what is not ok:
<?xml version="1.0" encoding="utf-8"?>
  Pour plus d’informations sur la configuration de votre application ASP.NET, rendez-vous sur
    <!-- For more information on Entity Framework configuration, visit -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <section name="saml2" type="SAML2.Config.Saml2Section, SAML2" />
    <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-saml20app-20150511012812.mdf;Initial Catalog=aspnet-saml20app-20150511012812;Integrated Security=True" providerName="System.Data.SqlClient" />
    <add key="webpages:Version" value="" />
    <add key="webpages:Enabled" value="false" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
    <add key="home.dir" value="C:\Users\myUser\Desktop\testMetadata\" />
    <authentication mode="None" />
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
      <remove name="FormsAuthentication" />
      <remove name="SAML2.Protocol.Saml20SignonHandler" />
      <remove name="SAML2.Protocol.Saml20LogoutHandler" />
      <remove name="SAML2.Protocol.Saml20MetadataHandler" />
      <add name="SAML2.Protocol.Saml20SignonHandler" verb="*" path="Login.ashx" type="SAML2.Protocol.Saml20SignonHandler, SAML2" />
      <add name="SAML2.Protocol.Saml20LogoutHandler" verb="*" path="Logout.ashx" type="SAML2.Protocol.Saml20LogoutHandler, SAML2" />
      <add name="SAML2.Protocol.Saml20MetadataHandler" verb="*" path="Metadata.ashx" type="SAML2.Protocol.Saml20MetadataHandler, SAML2" />
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
        <parameter value="mssqllocaldb" />
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />

    <serviceProvider id="urn:issuer" server="http://localhost:3301/">
        <endpoint localpath="Login.ashx" type="signon" redirectUrl="~/AuthenticatedHomePage" />
        <endpoint localpath="Logout.ashx" type="logout" redirectUrl="~/HomePage" />
        <endpoint localpath="Metadata.ashx" type="metadata" />
      <nameIdFormats allowCreate="true">
        <add format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient" />
      <authenticationContexts comparison="Exact">
        <add context="urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport" referenceType="AuthnContextClassRef" />
    <identityProviders metadata="C:\Users\myUser\Desktop\testMetadata\metadata_Kit_net_mma.xml" />
        <contact type="Administrative" company="" givenName="" surName="" email="" phone="" />
        <add name="urn:cn" />
Thanks in advance for the answer,
May 21, 2015 at 7:49 PM
Sorry for the delay, I don't get notifications when people post right now.

Did you get this figured out? It looked like you got at least a little bit farther, given your other message?
May 22, 2015 at 8:06 AM
Hi, thanks for the answer.

I managed to advance further but using a lot of code.

Concerning the localpath attribute, I found it in the Saml2Section file that the correct syntax is 'localPath' with a big 'P'.
I've got the same problem with the 'type' attribute, it needs to be 'SignOn', 'Logout' and 'Metadata' with bigs 'S', 'O', 'L' and 'M' respectively. To be honest it might be some more syntax errors that I don't remember right now... :(

I have in did another question concerning the source code, I will ask in another thread since it's not related.

Thanks again,