Forums, Documentation & Knowledge Base - ComponentSpace

Can SAMLProvider service be injected in startup.cs


https://componentspace.com/forums/Topic11946.aspx

By akanksha10 - 12/13/2021

Hi Team, 
Good Day !

Is there any way, we can use " await _samlServiceProvider.InitiateSsoAsync(partnerIdP, null);" call in Configure method of startup.cs as i am not able to inject it in constructor of startup as its not suggested.
Requirement is to replace present WsFederationDefaults with Componentspacesaml .

Thanks
Akanksha
By ComponentSpace - 12/14/2021

Yes, that will work. You can use either the middleware or SAML API in support of any of the SSO/SLO flows including SP-initiated SSO. The MiddlewareServiceProvider demonstrates using the SAML authentication handler middleware and the ExampleServiceProvider demonstrates calling the SAML API. The Examples Guide in the documentation folder walks you through these and other example projects.

The IdP can be an ASP.NET application or, in fact, any platform that supports the SAML v2.0 specification.