This gem is an OmniAuth strategy to support TrustAuth authentication.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install omniauth-trustauth
- First edit your layout.
- Add your handler for the OmniAuth callback. Here's an example of something simple:
# your trustauth callback handler def trustauth # if the user was authenticated if auth_hash['info']['result'] # find the public key in the database or create a new user user = User.find_or_create_by_public_key(auth_hash['info']['public_key']) # login if the user isn't logged in if not user_signed_in? sign_in_and_redirect(:user, user) end end redirect_to root_path end def auth_hash request.env['omniauth.auth'] end
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request