daily pastebin goal
24%
SHARE
TWEET

Untitled

a guest Jan 16th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top