Open ishagadekar opened 7 years ago
Hi! Thanks for your interest in AmIUnique! Can you give me the version of Java and Play you are using? It could help me sort this out.
I am using Java 8 and Play 2.4.6.
Starting with Play 2.4.x, Crypto methods stopped being static. Try with play 2.3.x
I tried with Play 2.3. It worked. Thanks!
Also, in the table "fpdata", for the "id" column, I get value "Not Supported". Can you tell me what does that mean? Thanks.
Thanks a lot @SyBen for finding out the cause of the problem! The site will probably go through a small refresh this year so we may upgrade to a more recent version of Play and this will change.
@ishagadekar The id value comes from the cookie we setup in the browser. If you get "Not Supported", it is either because cookies are blocked or the path may not be correct (i.e. if you run the site locally on your machine, it may not work).
@plaperdr Cookies are not blocked on my system and even if other person hits the website from their system, it gives "Not Supported" value. Can you tell me where are the paths configured? Also, what is the purpose of "id" vs "addressHttp" fields? Thanks.
The main path for cookies is defined on this line HERE. You can see that "amiunique.org" is directly in the code. The last two boolean values are to only allow the cookie to be used in the context of a secure connection (HTTPS) and to be delivered only through HTTP (no possibility to access it through JavaScript). If you want to use it on your own, I recommend setting at least the second-to-last boolean value (HTTPS one) to "false". The difference between "id" and "addressHttp" is simple. The "id" column is for the cookie value, the "addressHttp" is an hashed version of the IP address.
Okay. I will try doing that. Thank You!
Hi,
I am trying to run the code on my local machine and I am getting the below error:
[error] C:\amiunique\website\app\controllers\FPController.java:346: non-static method generateToken() cannot be referenced from a static context [error] Crypto.generateToken [error] C:\amiunique\website\app\controllers\FPController.java:347: non-static method encryptAES(java.lang.String) cannot be referenced from a static context [error] Crypto.encryptAES [error] C:\amiunique\website\app\controllers\StatsController.java:28: non-static method decryptAES(java.lang.String) cannot be referenced from a static context [error] Crypto.decryptAES
Please let me know what could be the issue.
Thanks in Advance!