Skip to content

How to: Integrate with Devise

Leonardo Crauss Daronco edited this page Jun 7, 2014 · 5 revisions

BigbluebuttonRails uses the method bigbluebutton_user to get the current user. This method by default returns current_user, a method that should be implemented by the user. In case you're integrating your application with Devise, current_user is already implemented by Devise, so you won't need to do anything to inform BigbluebuttonRails about the current user.

To set up authentication in the BigbluebuttonRails controllers, first learn How to: Inherit controllers. Then enable authentication in your custom controllers with:

class CustomServersController < Bigbluebutton::ServersController
  before_filter :authenticate_user!
end

class CustomRoomsController < Bigbluebutton::RoomsController
  before_filter :authenticate_user!
end

class CustomRecordingsController < Bigbluebutton::RecordingsController
  before_filter :authenticate_user!
end

For rooms, you might want to allow anonymous users to join conferences, so you can't block all the actions. You shouldn't require authentication at least for the actions: invite and auth. We also recommend not requiring authentication for running, so you any user can check whether a meeting is running or not (as done by the views invite and join_wait). And also the actions external and external_auth you might want to unblock so that anonymous users can join external rooms (rooms that were not created by your application, so that are not in the database).

class CustomRoomsController < Bigbluebutton::RoomsController
  before_filter :authenticate_user!, :except => [:invite, :auth, :running, :external, :external_auth]
end

Example application

Mconf-Web is the most complete implementation of an application that uses this gem (that we know of), so you can always use it as an example. The version of Mconf-Web curerntly in the branch branch-v2 uses Devise and it is well integrated with BigbluebuttonRails.

Clone this wiki locally