Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void ConfigureServices(IServiceCollection services)
- {
- services.AddAuthentication()
- .AddSaml2(options =>
- {
- options.SPOptions.EntityId = new EntityId("https://localhost:3131/Saml2");
- options.IdentityProviders.Add(
- new IdentityProvider(
- new EntityId("http://localhost:52071/Metadata"), options.SPOptions)
- {
- LoadMetadata = true
- });
- options.SPOptions.ServiceCertificates.Add(new X509Certificate2("Sustainsys.Saml2.Tests.pfx"));
- });
- }
- public class SsoController : Controller
- {
- private CustomSaml2Handler _customSaml2Handler;
- public SingleSignOnController(CustomSaml2Handler customSaml2Handler)
- {
- _customSaml2Handler = customSaml2Handler;
- }
- [Route("saml2/ACS")]
- [HttpPost]
- public ActionResult ACS()
- {
- try
- {
- // How I should call HandleRequestAsync ?
- // How to get principals/claims?
- }
- catch (Exception e)
- {
- }
- }
- }
Add Comment
Please, Sign In to add comment