Detail about CSRF token fetch request
- 2019 年 10 月 4 日
- 筆記
版權聲明:本文為部落客原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處鏈接和本聲明。
本文鏈接:https://jerry.blog.csdn.net/article/details/100849755
Created by Jerry Wang, last modified on Jun 17, 2015
- updateSecurityToken
- bTokenHandling
- x-csrf-token
- oServiceData.securityToken
- ODataModel._createBatchRequest
- ODataModel.prototype.refreshSecurityToken


Who has started this csrf token request? It is automatically done by oDataModel framework.

Now we know that everytime an HTTP post request is sent, the token will be forced to fresh from backend.
So it means it will not be repeatedly called every time we select another item in navigation list.

And by default, all oData instance should have set this flag as true, which could be observed in constructor.

And by default, all oData instance should have set this flag as true, which could be observed in constructor.


Created by Jerry Wang, last modified on Jul 22, 2015
- updateSecurityToken
- Security
- Token
- x-csrf-token
- bTokenHandling 以opportunity為例:

如果token不available,就發Odata request到後台去取:

問題:this.bTokenHandling什麼時候置為true?
在ODataModel的構造函數里。

