Is devise’s token_authenticatable secure?

token_authenticatable is vulnerable to timing attacks, which are very well explained in this blog post. These attacks were the reason token_authenticatable was removed from Devise 3.1. See the plataformatec blog post for more info. To have the most secure token authentication mechanism, the token: Must be sent via HTTPS. Must be random, of cryptographic strength. … Read more

cURL POST command line on WINDOWS RESTful service

I ran into the same issue on my win7 x64 laptop and was able to get it working using the curl release that is labeled Win64 – Generic w SSL by using the very similar command line format: C:\Projects\curl-7.23.1-win64-ssl-sspi>curl -H “Content-Type: application/json” -X POST http://localhost/someapi -d “{\”Name\”:\”Test Value\”}” Which only differs from your 2nd escape … Read more

Timezone lookup from latitude longitude [closed]

I looked fairly deeply into this question for a project I am working on. GeoNames.org and EarthTools.com are both good options for many situations but with the following serious flaws: GeoNames.org finds the time zone by searching for the nearest point in their database that contains a time zone field. This often leads to the … Read more

Return the current user with Django Rest Framework

With something like this you’re probably best off breaking out of the generic views and writing the view yourself. @api_view([‘GET’]) def current_user(request): serializer = UserSerializer(request.user) return Response(serializer.data) You could also do the same thing using a class based view like so… class CurrentUserView(APIView): def get(self, request): serializer = UserSerializer(request.user) return Response(serializer.data) Of course, there’s also … Read more

Getting my public IP via API [closed]

While not from big companies, all of these should work: curl icanhazip.com curl -s ‘http://checkip.dyndns.org’ | sed ‘s/.*Current IP Address: \([0-9\.]*\).*/\1/g’ host -t a dartsclink.com | sed ‘s/.*has address //’ curl curlmyip.com curl ifconfig.me # this has a lot of different alternatives too, such as ifconfig.me/host Source http://www.commandlinefu.com/commands/view/2966/return-external-ip#comment

Cheapest way to send SMS for number verification? [closed]

I’d suggest using TextAnywhere: Text Anywhere They provide API’s (C, Java, .Net, PHP etc) for several languages and provide a multitude of rates and packages depending on the volume of texts sent. They’re also very flexible with regards to payment – they do pre-pay, PAYG and fixed monthly limits. Pricing We used them for a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)