Sha256: 6991c6497e3828ab32f6121de74cef2e2ff6e5eaa211a8b47f9c31b09d662563

Contents?: true

Size: 1.33 KB

Versions: 3

Compression:

Stored size: 1.33 KB

Contents

Doorkeeper.configure do
  # This block will be called to check whether the
  # resource owner is authenticated or not
  resource_owner_authenticator do |routes|
    # Put your resource owner authentication logic here.
    # If you want to use named routes from your app you need
    # to call them on routes object eg.
    # routes.new_user_session_path
    # e.g. User.find_by_id(session[:user_id]) || redirect_to(routes.new_user_session_url)
    User.find_by_id(session[:user_id]) || redirect_to(routes.root_url, :alert => "Needs sign in.")
  end

  # If you want to restrict the access to the web interface for
  # adding oauth authorized applications you need to declare the
  # block below
  # admin_authenticator do |routes|
  #   # Put your admin authentication logic here.
  #   # If you want to use named routes from your app you need
  #   # to call them on routes object eg.
  #   # routes.new_admin_session_path
  #   Admin.find_by_id(session[:admin_id]) || redirect_to(routes.new_admin_session_url)
  # end

  authorization_scopes do
    scope :public, :default => true, :description => "The public one"
    scope :write, :description => "Updating information"
  end

  # Access token expiration time (default 2 hours)
  # access_token_expires_in 2.hours

  # Issue access tokens with refresh token (disabled by default)
  use_refresh_token
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
doorkeeper-0.3.4 spec/dummy/config/initializers/doorkeeper.rb
doorkeeper-0.3.3 spec/dummy/config/initializers/doorkeeper.rb
doorkeeper-0.3.2 spec/dummy/config/initializers/doorkeeper.rb