0

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.

Elmor
  • 4,775
  • 6
  • 38
  • 70

2 Answers2

1

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

Elmor
  • 4,775
  • 6
  • 38
  • 70
0

This devise encryptor doing same thing as bcrypt auth in golang, also i dont see Rails Devise hash and go-devise-encryptor password hash equal.