ruby-on-railsgodevisebcryptbeego

Golang duplicate rails Devise gem password encryption


I have to authenticate user in a new app which uses Beego framework for Golang, twist is that DB is from Rails application where authentication is implemented using gem Devise .
I've looked at gem Bcrypt implementation
https://github.com/codahale/bcrypt-ruby/blob/master/lib/bcrypt/password.rb
But can't quite grasp how to replicate encrypted_password to validate user...
Can you please help me ?

UPDATE1
using bcrypt didn't help

b_password := []byte(password)
hashedPassword, err := bcrypt.GenerateFromPassword(b_password, bcrypt.DefaultCost)

I get different passwords.


Solution

  • I found out https://github.com/consyse/go-devise-encryptor exactly for doing this task