jitbit / AspNetSaml

Very simple SAML 2.0 consumer module for ASP.NET/C#
https://www.jitbit.com
Apache License 2.0
363 stars 117 forks source link

AspnetSaml SAmlresponse received null from Web form how to call samlconsumer.Can i use post method to send request #56

Closed ghost closed 2 years ago

ghost commented 3 years ago

Iam using aspnetsaml to SSO authentication page load i called "GetRedirectUrl" to called IDp and getting Samlrequest URL. where i need to call "Samlconsumer" after getredirect iam getting null from response. how to achieve asp.net web form

static void Redir(Response samlResponse) { //specify the SAML provider url here, aka "Endpoint" var samlEndpoint = "https://saml.xxxx.com/idp/SSO.saml2"; AuthRequest request = new AuthRequest( "https://www.xxxx.com/", //put your app's "unique ID" here "https://localhost:xxxxx/Home/SamlConsume" //assertion Consumer Url - the redirect URL where the provider will send authenticated users ); string url = request.GetRedirectUrl(samlEndpoint); Saml.Response samlResponse = new Response(samlCertificate, Request.Form["SAMLResponse"]);--it is valid to call Response.Redirect(url); }

Sabin-Pradhan commented 2 years ago

Does Request.Form["SAMLResponse"] work on webforms to get the response sent back by IDP as post? If not, how to grab the IDP response sent on post payload on asp.net webforms.