小编Par*_*rar的帖子

如何在Cakephp 3中的ajax调用中定义CSRF令牌.另外,如何为某些ajax请求关闭CSRF

在Cakephp3中启用Csrf组件时.我如何在ajax调用中使用它.在此beforeSend参数中,ajax csrf标记在标头中设置.什么是价值csrfToken.因为它给出了错误

csrfToken未定义

beforeSend: function(xhr){
    xhr.setRequestHeader('X-CSRF-Token', csrfToken);
},
Run Code Online (Sandbox Code Playgroud)

另外,如何禁用某些ajax调用的Csrf组件.

ajax cakephp csrf cakephp-3.x

7
推荐指数
1
解决办法
5747
查看次数

如何在java中为google设置OAuth2的重定向URI

我运行此代码,但它给出错误:redirect_uri_mismatch.我在client_secret.json文件中设置重定向uri.但每次重定向uri都像http:// localhost:53271/Callback(端口号每次更改)但不是我在client_secret.json中给出的那个.

public class SheetsQuickstart {

private static final String APPLICATION_NAME = "Web client 1";

    private static final java.io.File DATA_STORE_DIR = new java.io.File(
    System.getProperty("user.home"), ".credentials/sheets.googleapis.com-java-quickstart");

/** Global instance of the {@link FileDataStoreFactory}. */
private static FileDataStoreFactory DATA_STORE_FACTORY;

/** Global instance of the JSON factory. */
private static final JsonFactory JSON_FACTORY =
    JacksonFactory.getDefaultInstance();

/** Global instance of the HTTP transport. */
private static HttpTransport HTTP_TRANSPORT;

/** Global instance of the scopes required by this quickstart.
 *
 * If modifying …
Run Code Online (Sandbox Code Playgroud)

java google-api url-redirection

2
推荐指数
1
解决办法
1360
查看次数

标签 统计

ajax ×1

cakephp ×1

cakephp-3.x ×1

csrf ×1

google-api ×1

java ×1

url-redirection ×1