29 Sep '16, 2pm

Authenticate Your #Rails API with JWT from Scratch:

require 'jwt' class JsonWebToken # Encodes and signs JWT Payload with expiration def self.encode(payload) payload.reverse_merge!(meta) JWT.encode(payload, Rails.application.secrets.secret_key_base) end # Decodes the JWT with the signed secret def self.decode(token) JWT.decode(token, Rails.application.secrets.secret_key_base) end # Validates the payload hash for expiration and meta claims def self.valid_payload(payload) if expired(payload) || payload['iss'] != meta[:iss] || payload['aud'] != meta[:aud] return false else return true end end # Default options to be encoded in the token def self.meta { exp: 7.days.from_now.to_i, iss: 'issuer_name', aud: 'client', } end # Validates if the token is expired by exp parameter def self.expired(payload) Time.at(payload['exp']) < Time.now end end

Full article: https://www.sitepoint.com/authenticate-your-rails-api-wit...

Tweets

Ruby on Rails Developer

freelance.nl 30 Sep '16, 8am

Ik ben op zoek naar een developer die nieuwe features kan ontwikkelen voor mijn platform. Wij werken met Betty Blocks dat ...

Ruby on Rails by quema

freelancer.com 28 Sep '16, 12am

drag drop tree ajax mysql asp rails ruby

New Job Alert: Build Rails API by omneos

freelancer.com 28 Sep '16, 11am

we currently have a completely custom website ecommerce backend that we build using our current design team , we currently...

Why you should build your web #startup using #R...

blog.katanacode.com 29 Sep '16, 5pm

I can still remember how my face lit up with delight at the laptop screen in front of me. This was back in 2008 — I was si...

Software Engineer (Web Applications Ruby on Rai...

kenyanjobs.co.ke 22 Sep '16, 8am

1+ year of strong web application development skills You must have solid development habits (testing, documentation, etc.)...

Why you should build your web startup using #Ru...

blog.katanacode.com 30 Sep '16, 1am

I can still remember how my face lit up with delight at the laptop screen in front of me. This was back in 2008 — I was si...

How to generate a swagger docs for Rails API

rubyflow.com 23 Sep '16, 6am

How to generate a swagger docs for Rails API by James Darryl — Today Making API for a Rails application is simple for a Ru...

Ruby on Rails

vps.remmont.com 20 Sep '16, 3am

Imagine what you could build if you learned Ruby on Rails Learning to build a modern web application is daunting. Ruby on ...

.@TaxJar is looking for a Ruby on Rails Developer

remotejobs.com 29 Sep '16, 10pm

TaxJar is the leading technology solution for busy eCommerce sellers to manage sales tax and is trusted by more than 5,000...

The Best Ruby on Rails Hosting Services – Progr...

vps.remmont.com 20 Sep '16, 4am

The Best Ruby on Rails Hosting Services In this report I outline what I consider to be some of the best Ruby on Rails host...

ruby on rails by bbillington

freelancer.com 19 Sep '16, 11am

drag drop tree ajax mysql asp rails ruby

Ruby on Rails Hosting

hosting.remmont.com 20 Sep '16, 3am

Deploy a highly scalable and fault tolerant Ruby on Rails hosting configuration within minutes on our premium tier-1 netwo...

The Last API Wrapper: Pragmatic API wrapper fra...

rubyflow.com 19 Sep '16, 8am

× The Ruby and Rails community linklog Made a library? Written a blog post? Found a useful tutorial? Share it with the Rub...

Learn Ruby on Rails from Scratch Coupon|Free

mycoursecoupon.com 09 Oct '16, 6pm

This course teaches you the amazing and powerful technology of Ruby on Rails. This technology forms the backend of amazing...

Ruby on rails project

freelance.nl 17 Sep '16, 9am

Momenteel mag ik voor een bekende high-traffic e-commerce organisatie zoeken naar Nederlands beste Ruby on Rails Developer...