Skip to content

Commit

Permalink
Regenerating doorkeeper configs; configuring scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Sep 26, 2012
1 parent 0de6362 commit 073c74f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
12 changes: 3 additions & 9 deletions config/initializers/doorkeeper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
resource_owner_authenticator do |routes|
User.first(:id => session[:user_id]) ||
redirect_to(routes.login_path(return_to: request.fullpath))
# Put your resource owner authentication logic here.
# If you want to use named routes from your app, you need to call them on the routes object.
# For example:
# routes.new_user_session_path
# Example implementation:
# User.find_by_id(session[:user_id]) || redirect_to(routes.new_user_session_url)
end

# If you want to restrict access to the web interface for adding oauth authorized applications, you need to declare the block below.
Expand All @@ -37,12 +31,12 @@
# Optional parameter :confirmation => true (default false) if you want to enforce ownership of
# a registered application
# Note: you must also run the rails g doorkeeper:application_owner generator to provide the necessary support
# enable_application_owner :confirmation => false
enable_application_owner :confirmation => true

# Define access token scopes for your provider
# For more information go to https://github.com/applicake/doorkeeper/wiki/Using-Scopes
# default_scopes :public
# optional_scopes :write, :update
default_scopes :read
optional_scopes :write

# Change the way client credentials are retrieved from the request object.
# By default it retrieves first from the `HTTP_AUTHORIZATION` header, then
Expand Down
7 changes: 7 additions & 0 deletions config/locales/doorkeeper.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ en:
invalid_uri: 'must be a valid URI.'
relative_uri: 'must be an absolute URI.'
doorkeeper:
scopes:
read: 'Access your public data'
write: 'Post on your behalf and update your information'
errors:
messages:
# Common error messages
Expand All @@ -41,6 +44,10 @@ en:
server_error: 'The authorization server encountered an unexpected condition which prevented it from fulfilling the request.'
temporarily_unavailable: 'The authorization server is currently unable to handle the request due to a temporary overloading or maintenance of the server.'

#configuration error messages
credential_flow_not_configured: 'Resource Owner Password Credentials flow failed due to Doorkeeper.configure.resource_owner_from_credentials being unconfigured.'
resource_owner_authenticator_not_configured: 'Resource Owner find failed due to Doorkeeper.configure.resource_owner_authenticator being unconfiged.'

# Access grant errors
unsupported_response_type: 'The authorization server does not support this response type.'

Expand Down

0 comments on commit 073c74f

Please sign in to comment.