Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Restrict who authenticates through Janrain with a regexp

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 rpx_regexp.gemspec
README.md

RPX_Regexp

Whenever we want to authenticate users on a Rails app, we like to go with Janrain + Devise.

To achieve this we use this excelent gem that just makes everything very easy.

Sometimes we like to do our own apps where only users in our domain have access, and we use this gem to make sure Janrain and Devise only authenticates our users.

Usage

Add the gem to your Gemfile or require it depending on what you are using.

Then, just set your email RegExp somewhere on your code:

RPXNow.email_regexp = /@crowdint.com$/

For rails, you can put it on an initializer. Since this is authentication code, I usually put it on initializers/devise.rb

About the Author

Crowd Interactive is a Ruby and Rails consultancy firm powered by a team of enthusiast engineers who love programming. We turn your ideas into web applications, and we like challenging projects. We also have a lot of experience in retail, so it doesn't matter if your idea is about something you'd like to sell, we can surely help you.

Something went wrong with that request. Please try again.