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

custom pipeline #8

Open
leungkimming opened this issue Apr 6, 2022 · 10 comments
Open

custom pipeline #8

leungkimming opened this issue Apr 6, 2022 · 10 comments

Comments

@leungkimming
Copy link
Owner

//app.Use((context, next) =>
//{
// IAntiforgery antiforgery = app.Services.GetServices().FirstOrDefault();
// var user = context.User.Identity.Name;

// if (context.Request.Path.Value.Equals("/"))
// {
// return next(context);
// }

// if (!context.Request.Path.Value.EndsWith("login", StringComparison.InvariantCultureIgnoreCase))
// {
// var theaders = context.Request.Headers["X-CSRF-TOKEN-HEADER"];
// string theader = "";
// if (theaders.Count() > 0)
// {
// theader = theaders[0];
// }
// System.Diagnostics.Debug.WriteLine($"Path={context.Request.Path.Value} User={user}, Token={theader}");
// try
// {
// antiforgery.ValidateRequestAsync(context);
// }
// catch (AntiforgeryValidationException ex)
// {
// context.Response.StatusCode = 400;
// System.Diagnostics.Debug.WriteLine($"Invalid antiforgery token: {ex.Message}");
// throw new BadHttpRequestException($"Invalid antiforgery token: {ex.Message}");
// }
// }

// var tokens = antiforgery.GetAndStoreTokens(context);
// System.Diagnostics.Debug.WriteLine($"Path={context.Request.Path.Value} User={user}, NewToken={tokens.RequestToken}");
// context.Response.Cookies.Append("XSRF-TOKEN", tokens.RequestToken, new CookieOptions() { HttpOnly = false });
// return next(context);
//});

@leungkimming
Copy link
Owner Author

dotnet6EAA.zip

@leungkimming
Copy link
Owner Author

dotnet6EAA (1).zip

@leungkimming
Copy link
Owner Author

release_var
build_var
release_step

@leungkimming
Copy link
Owner Author

changes
launchSettings.zip

@leungkimming
Copy link
Owner Author

Program.zip

@leungkimming
Copy link
Owner Author

releaseParm

@leungkimming
Copy link
Owner Author

@leungkimming
Copy link
Owner Author

@leungkimming
Copy link
Owner Author

@leungkimming
Copy link
Owner Author

releaseParm1
releaseParm

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

1 participant