Skip to content

Instantly share code, notes, and snippets.

@craigplummer
Created July 29, 2016 15:46
Show Gist options
  • Save craigplummer/b025056d4629bb177bca55a77bd53c6e to your computer and use it in GitHub Desktop.
Save craigplummer/b025056d4629bb177bca55a77bd53c6e to your computer and use it in GitHub Desktop.
Using Microsoft Azure AD for API Authentication with Rails and Warden - warden_helper.rb
module WardenHelper
extend ActiveSupport::Concern
included do
helper_method :warden, :current_user
prepend_before_filter :authenticate!
end
def current_user
warden.user
end
def warden
request.env['warden']
end
def authenticate!
warden.authenticate!
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment