Sustainsys / Saml2

Saml2 Authentication services for ASP.NET
Other
952 stars 600 forks source link

Question - reach 404 when trying to get project meta #1262

Closed bczm8703 closed 3 years ago

bczm8703 commented 3 years ago

I am trying to retrieve the metadata to import to my ADFS by going to https://localhost:44342/saml2 but I keep receiving 404.

not sure if it is related but how do I get the pfx from my ADFS?

I try to export the token signing cert from adfs but it seems to only also cer format and the service communication cert from the ADFS does not seem to allow me to export with the key

wylermat commented 3 years ago

Hi, the handler is case-sensitive. Try https://localhost:44342/Saml2 The tokoens are not signed with the adfs-certificate. you should create your own and register your application with that in adfs.

flodet-me commented 3 years ago

Hello folks,

I'm experiencing a similiar issue. As OP, my ACS and Metadata are not mapped. (e.g. localhost:5001/Saml2, localhost:5001/Saml2/acs)

I've tried multiple things:

My interpretation:

I'm pretty certain, that only the mapping is not working. The generated SAML Request is working and the response from my designated IdP is also looking like expected. As the application is not serving the metadata I'm convinced there is either an issue with the mapping of the controller or on the site of configuration.

I'm hopping anyone can provide some knowledge for further debugging or a solutions. Following are some technical informations.


Technical details

Application:

Mapping:

services.AddControllersWithViews(options =>
            {
                options.Filters.Add(new AuthorizeFilter());
            })
app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();

                endpoints.MapHealthChecksUI();
            });

Saml Integration:

 .AddSaml2(options =>
                {
                    options.SPOptions.EntityId = new EntityId("EntityId");

                    options.IdentityProviders.Add(
                        new IdentityProvider(new EntityId(authSettings.SamlSettings.IdPEntityId), options.SPOptions)
                        {
                            MetadataLocation = "res\\metadata.xml"
                        });
                });
bczm8703 commented 3 years ago

Hi, the handler is case-sensitive. Try https://localhost:44342/Saml2 The tokoens are not signed with the adfs-certificate. you should create your own and register your application with that in adfs.

hi thanks for the help I am able to load the saml XML now. just checking how do I create the pfx cert.

i am receiving the exception: CryptographicException: Invalid provider type specified.

is it possible to use my ADFS token signing cert and make it into pfx?

wylermat commented 3 years ago

Are you using .net5?

bczm8703 commented 3 years ago

Are you using .net5?

i run the sample provided here. the only changes done is the adfs URL and tired to change to pfx file

AndersAbel commented 3 years ago

Closing this as the original issue was case sensitivity.