capture OWIN/Katana ws-fedp security token


image

 

 

image

1 public partial class Startup1 2 { 3 public string token; 4 5 public void ConfigureAuth(IAppBuilder app) 6 { 7 app.UseCookieAuthentication( 8 new CookieAuthenticationOptions 9 { 10 AuthenticationType = 11 WsFederationAuthenticationDefaults.AuthenticationType 12 }); 13 14 var foo = new WsFederationAuthenticationOptions 15 { 16 //MetadataAddress = "https://login.windows.net/rapmlsqa.com/federationmetadata/2007-06/federationmetadata.xml", 17 // MetadataAddress = "https://ssoportal.rapmlsqa.com/spinitiatedssohandler.aspx/VCRD/24", 18 // Wtrealm = "https://wsfedreso.azurewebsites.net/", 19 MetadataAddress = "https://vcrdazuresso.accesscontrol.windows.net/FederationMetadata/2007-06/FederationMetadata.xml ", 20 Wtrealm = "https://localhost:44300/", 21 22 }; 23 foo.SecurityTokenHandlers.AddOrReplace(new CustomJwtSecurityTokenHandler()); 24 25 foo.Notifications = new WsFederationAuthenticationNotifications(); 26 foo.Notifications.SecurityTokenReceived = (context) => 27 { 28 token = context.SecurityToken; 29 30 return Task.FromResult(0); 31 }; 32 33 app.UseWsFederationAuthentication(foo); 34 } 35 } 36

Advertisements

About home_pw@msn.com

Computer Programmer who often does network administration with focus on security servers. Very strong in Microsoft Azure cloud!
This entry was posted in katana. Bookmark the permalink.