I am using play-2.2.3 to develop APIs. These APIs are accessed by a PHP/JQuery front-end. Simple example would be a resetPassword API. From the PHP, when I call the reset password API, it should be protected by a CSRF token so that someone cannot simply call that API and reset someone else's password. Short of rendering the form using Scala (provided by Play-2.2.3), is there a way to manually have single-use server-side tokens which appear as hidden form fields in the reset password form and get verified in the post request by the server on submit of the form?
How can I use CSRF tokens provided by the play framework (play-2.2.3) with a PHP front-end?
903 Views Asked by Farhad At
1
There are 1 best solutions below
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in PHP
- php Variable name must change in for loop
- register_shutdown_function is not getting called
- Query returning zero rows despite entries existing
- Retrieving *number* pages by page id
- Automatically closing tags in form input?
- How to resize images with PHP PARSE SDK
- how to send email from localhost using codeigniter?
- Mariadb max Error while sending QUERY packet PID
- Multiusers login redirect different page in php
- Imaginary folder when I use "DirectoryIterator" in PHP?
- CodeIgniter + XDebug: debug only working in the main controller, index() function
- PHP script timeout when I use sleep()
- posting javascript populated form to another php page
- AJAX PHP - Reload div after submit
- PHP : How can I check Array in array?
Related Questions in PLAYFRAMEWORK
- Auto reload with play2
- Log of dependency does not show
- Json implicit format with recursive class definition
- Async LDAP authentication with play framework
- Why do I get an IndexOutOfBoundsException when my else should prevent it?
- Play 2.4 scala I am facing issues getting messages implicit in my code
- Play template project requires subscription to typesafe, why?
- hot swap in sbt project without play-plugin
- Getting "Cannot find HTTP header here" in play framework Scala
- How can I redirect to an error page in my Play app?
- How do you iterate over json when the schema is not known up front?
- Play Scala Converting sync to async
- morphia Geo-spatial "near" method in embedded list
- How to modify queryString and body of the request before being processed by the routes in Playframework 2 Scala?
- Not able to access key-values pairs in a JSON using Play library in scala
Related Questions in CSRF
- CSRFProtector PHP library won't submit any form data
- Can I use plone.protect 3.0 with Plone 4.3?
- CORS and CSRF(XSRF)
- XHR2 file upload to subdomain token mismatch in Laravel5.1/nginx upload module
- Laravel X-CSRF-Token mismatch with POSTMAN
- Should all the form's submit work after a valid one submit with CSRF?
- Does an anonymous comment/post form need csrf token? If not why does SO use it and how to implement it?
- How to know if my CSRF is working?
- Csurf invalid csrf token Express / nodejs
- Django CSRF cookie not set error if there is cookie value starting with square brackets '['
- Invalid authentication token after session timeout
- Is Encrypted Token Pattern CSRF protection immune to BREACH attack?
- Verifying that Play's CSRF protection is working
- Would I need CSRF if using JWT?
- Django Rest Framework remove csrf
Related Questions in CSRF-PROTECTION
- CSRFProtector PHP library won't submit any form data
- Does an anonymous comment/post form need csrf token? If not why does SO use it and how to implement it?
- Is Encrypted Token Pattern CSRF protection immune to BREACH attack?
- Laravel 5 and Internet Explorer : Token Mismatch
- How can I use CSRF tokens provided by the play framework (play-2.2.3) with a PHP front-end?
- Flask : CSRF verification failed
- Yii2 validateCsrfToken does not work as expected
- Laravel- Token missmatch exception in Ajax Request
- Why doesn't pre-flight CORS block CSRF attacks?
- Is it necessary to generate anti-XSRF/CSRF token in server side?
- API CSRF protection
- When or when not to use CSRF in APIs?
- How to redirect with InvalidAuthenticityToken error
- How to send csrf token in AJAX request (Without Jquery) in expressjs?
- Symfony2: Invalid CSRF token while remember me authentication
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Figured out how to do this.
@AddCSRFTokenannotation on a method that will set a cookie calledPLAY_SESSION=.....-csrfToken=........PLAY_SESSIONcookie entirely, AND in the queryString, pass thecsrfToken=......