Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Response' does not contain a definition for 'Redirect' #19

Closed
JorgeGHS opened this issue Jul 18, 2019 · 1 comment
Closed

'Response' does not contain a definition for 'Redirect' #19

JorgeGHS opened this issue Jul 18, 2019 · 1 comment

Comments

@JorgeGHS
Copy link

JorgeGHS commented Jul 18, 2019

I am trying to use the AspNetSaml nuget package and I am getting an error when trying to use the Response.Redirect(url) method.

This is the error:
Error CS0117 'Response' does not contain a definition for 'Redirect'

I am already using the namespace System.Web and also I added the System.Web.dll

CODE:

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://www.xxxx.com/" //assertion Consumer Url - the redirect URL where the provider will send authenticated users
                );

            // Generate the provider URL
            string url = request.GetRedirectUrl(samlEndpoint);

            Response.Redirect(url);
        }))
@alex-jitbit
Copy link
Member

alex-jitbit commented Jul 19, 2019

You're using the example wrong, it's an example of usage from ASP.NET MVC app only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants