Migration from old versions
Clone this wiki locally
Follow latest changes (specially backwards incompatible ones, we follow semantic versioning) in the NEWS: https://github.com/doorkeeper-gem/doorkeeper/blob/master/NEWS.md.
From 4.x to 5.x
Doorkeeper::Applicationnow has a new boolean column named
trueby default and has
NOT NULL CONSTRAINT. This column is required to allow creating Public & Private Clients as mentioned in Section 8.5 of draft-ietf-oauth-native-apps-12 of OAuth 2 RFC. If you are migrating from the Doorkeeper <= 5.0, then you can easily add this column by generating proper migration file using the following command:
rails g doorkeeper:confidential_applications
Doorkeeper#installed?methods was removed, so any Doorkeeper ORM extension don't need to support this methods starting from 5.0.
From 0.4.x to 0.5.x
Doorkeeper is not an isolated engine anymore. Which means that most of paths and old related engine methods won't work. Here's a list of things that changed:
mount Doorkeeper::Enginewon't work. Replace it with
- All route paths have changed. If you generated all views of use custom ones you'll have to prepend
oauth_to each of them:
# also applies to prefixes (edit_ and new_) authorized_applications(_path|_url) => oauth_authorized_applications(_path|_url) applications(_path|_url) => oauth_applications(_path|_url) authorization(_path|_url) => oauth_authorization(_path|_url)
- The locale file has been updated. You'll need to reinstall the file with
rails g doorkeeper:install(ignore other existing files) to ensure the gem works properly.
- Authorization code is now configurable:
From 0.3.x to 0.4.x
resource_owner_id accepts null values, since we now support Client Credentials flow.
change_column :oauth_access_tokens, :resource_owner_id, :integer, :null => true
Two things were changed in scopes
- The configuration for scopes has changed. You now have to use
optional_scopesinstead of the
Doorkeeper.configure do default_scopes :public optional_scopes :write, :update end
- You have to translate your scopes into a your application's locale file.
en: doorkeeper: scopes: public: "Access your public data" write: "Update your data"
From 0.2.x to 0.3.x
Add indexes to database:
class UpgradeToVersion03 < ActiveRecord::Migration def change add_index :oauth_applications, :uid, :unique => true add_index :oauth_access_grants, :token, :unique => true add_index :oauth_access_tokens, :token, :unique => true add_index :oauth_access_tokens, :resource_owner_id add_index :oauth_access_tokens, :refresh_token, :unique => true end end
From 0.1.x to 0.2.x
doorkeeper_fordoes not accept
class UpgradeToVersion02 < ActiveRecord::Migration def change add_column :oauth_access_grants, :scopes, :string # If you are upgrading from version 0.1.0, uncomment the line below # add_column :oauth_access_grants, :revoked_at, :datetime add_column :oauth_access_tokens, :refresh_token, :string add_column :oauth_access_tokens, :scopes, :string add_column :oauth_access_tokens, :expires_in, :integer remove_column :oauth_access_tokens, :expires_at end end