csrf

How to use Postman for Laravel $_POST request

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How can I try sending a post request to a Laravel app with Postman? Normally Laravel has a csrf_token that we have to pass with a POST/PUT request. How can I get and send this value in Postman? Is it even possible without turning off the CSRF protection? 回答1: Edit: Ah wait, I misread the question. You want to do it without turning off the CSRF protection? Like Bharat Geleda said: You can make a route that returns only the token and manually copy it in a _token field in postman. But I would recommend excluding your api calls from the CSRF

Spring Single Page Application: CSRF token changing silently after login, logout etc

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: As I know, in a Spring+JavaScript single page application, we need to send the CSRF token to the client in some way. A recommended way would be to have a CsrfHeaderFilter as described in this Spring guide . Following this approach, when the application will start, it will send a GET request to the server, thus fetching the token. But I see that under certain events like login or logout , Spring Security changes the token. CsrfHeaderFilter comes beforehand, and so can't detect the change. Hence, I am needing to send another GET request

Symfony2: The CSRF token is invalid. Please try to resubmit the form

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a form wher I have to fill in some information in a field. Even if I put something inside, I am getting the error: The CSRF token is invalid. Please try to resubmit the form Related to this question: symfony2 CSRF invalid I am using correctly the $form->bindRequest() if ($this->getRequest()->getMethod() == 'POST') { $form->bindRequest($this->getRequest()); if ($form->isValid()) { ... } Here is my template (twig) code: <div class="item item-last"> <h1>Create Affiliation</h1> {% if valid == false %} <div class="error"> {{ form_errors

Spring Security 3.2 CSRF disable for specfic URLs

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Enabled CSRF in my Spring MVC application using Spring security 3.2. My spring-security.xml <http> <intercept-url pattern="/**/verify" requires-channel="https"/> <intercept-url pattern="/**/login*" requires-channel="http"/> ... ... <csrf /> </http> Trying to disable CSRF for requests that contain 'verify' in request URL. MySecurityConfig.java @Configuration @EnableWebSecurity public class MySecurityConfig extends WebSecurityConfigurerAdapter { private CsrfMatcher csrfRequestMatcher = new CsrfMatcher(); @Override public void configure

Expected CSRF token not found. Has your session expired 403

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to write my test spring security application with mkyong examples. Spring Security: 4.0.0.RC1 Spring: 4.1.4.RELEASE I have the following security config: <http auto-config="true"> <intercept-url pattern="/admin**" access="hasRole('ADMIN')"/> <form-login authentication-failure-url="/?auth_error" username-parameter="user" password-parameter="password" login-page="/" default-target-url="/?OK"/> <!-- <csrf/> --> </http> <authentication-manager> <authentication-provider> <user-service> <user name="mkyong" password="123456" authorities=

How secure is HTTP_ORIGIN?

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I want to find out whether an incoming HTTP_REQUEST call from a third party website is coming from the list of domains that I defined. I know that HTTP_REFERER can be used to find out where the third party domain is, but it is not secure enough. People can spoof it or use Telnet to fake it. So, how about HTTP_ORIGIN? Is it sent from all browsers? Is it secure? Also, can people fake the REMOTE_ADDR in a HTTP_REQUEST call? 回答1: HTTP_ORIGIN is a way to protect against CSRF (Cross Site Request Forgery) requests. Currently it is

Django CSRF Cookie Not Set

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have some problem for a while now, I'm experiencing CSRF Cookie not set. Please look at the codes below Python def deposit(request,account_num): if request.method == 'POST': account = get_object_or_404(account_info,acct_number=account_num) form_=AccountForm(request.POST or None, instance=account) form = BalanceForm(request.POST) info = str(account_info.objects.filter(acct_number=account_num)) inf=info.split() if form.is_valid(): #cd=form.cleaned_data now = datetime.datetime.now() cmodel = form.save() cmodel.acct_number=account_num

codeigniter CSRF error: “The action you have requested is not allowed.”

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i enabled the csrf_protection option in the codeigniter's config file, and used form_open() function to creat my forms. but when i submit the form, this error occurs: The action you have requested is not allowed. i have done the answers like this topic (taht is most related to my question): question but they didn't work and The problem still remains. config.php <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /* |-------------------------------------------------------------------------- | Base Site URL |------------

Passing csrftoken with python Requests

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: How do you pass a csrftoken with the python module Requests? This is what I have but it's not working, and I'm not sure which parameter to pass it into (data, headers, auth...) import requests from bs4 import BeautifulSoup URL = 'https://portal.bitcasa.com/login' client = requests . session ( config ={ 'verbose' : sys . stderr }) # Retrieve the CSRF token first soup = BeautifulSoup ( client . get ( 'https://portal.bitcasa.com/login' ). content ) csrftoken = soup . find ( 'input' , dict ( name = 'csrfmiddlewaretoken' ))[ 'value' ]

WARNING: Can't verify CSRF token authenticity rails

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am sending data from view to controller with AJAXand I got this error: WARNING: Can't verify CSRF token authenticity I think I have to send this token with data. Does anyone know how can I do this ? Edit: My solution I did this by putting the following code inside the AJAX post: headers: { 'X-Transaction': 'POST Example', 'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content') }, 回答1: You should do this: Make sure that you have <%= csrf_meta_tag %> in your layout Add beforeSend to all the ajax request to set the header like below: $