Guest User

Untitled

a guest
Jan 16th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. public void ConfigureServices(IServiceCollection services)
  2. {
  3. services.AddAuthentication()
  4. .AddSaml2(options =>
  5. {
  6. options.SPOptions.EntityId = new EntityId("https://localhost:3131/Saml2");
  7. options.IdentityProviders.Add(
  8. new IdentityProvider(
  9. new EntityId("http://localhost:52071/Metadata"), options.SPOptions)
  10. {
  11. LoadMetadata = true
  12. });
  13.  
  14. options.SPOptions.ServiceCertificates.Add(new X509Certificate2("Sustainsys.Saml2.Tests.pfx"));
  15. });
  16. }
  17.  
  18. public class SsoController : Controller
  19. {
  20. private CustomSaml2Handler _customSaml2Handler;
  21. public SingleSignOnController(CustomSaml2Handler customSaml2Handler)
  22. {
  23. _customSaml2Handler = customSaml2Handler;
  24. }
  25.  
  26. [Route("saml2/ACS")]
  27. [HttpPost]
  28. public ActionResult ACS()
  29. {
  30. try
  31. {
  32. // How I should call HandleRequestAsync ?
  33. // How to get principals/claims?
  34. }
  35. catch (Exception e)
  36. {
  37.  
  38. }
  39. }
  40. }
Add Comment
Please, Sign In to add comment