Ruby on rails 在仅api_模式下使用Doorkeeper和Rails时,如何创建新的应用程序?

Ruby on rails 在仅api_模式下使用Doorkeeper和Rails时,如何创建新的应用程序?,ruby-on-rails,oauth-2.0,doorkeeper,Ruby On Rails,Oauth 2.0,Doorkeeper,我有一个Rails5API_-only应用程序,我正在添加doorkeeper作为Oauth2提供者,也在api_-only模式下 当我使用仅api_模式时,我为门卫添加了以下路线: Prefix Verb URI Pattern Controller#Action native_oauth_auth

我有一个Rails5API_-only应用程序,我正在添加doorkeeper作为Oauth2提供者,也在api_-only模式下

当我使用仅api_模式时,我为门卫添加了以下路线:

                    Prefix Verb   URI Pattern                                                                              Controller#Action
native_oauth_authorization GET    /oauth/authorize/native(.:format)                                                        doorkeeper/authorizations#show
       oauth_authorization GET    /oauth/authorize(.:format)                                                               doorkeeper/authorizations#new
                           DELETE /oauth/authorize(.:format)                                                               doorkeeper/authorizations#destroy
                           POST   /oauth/authorize(.:format)                                                               doorkeeper/authorizations#create
               oauth_token POST   /oauth/token(.:format)                                                                   doorkeeper/tokens#create
              oauth_revoke POST   /oauth/revoke(.:format)                                                                  doorkeeper/tokens#revoke
          oauth_introspect POST   /oauth/introspect(.:format)                                                              doorkeeper/tokens#introspect
          oauth_token_info GET    /oauth/token/info(.:format)                                                              doorkeeper/token_info#show
中列出的用于创建应用程序(获取我的
客户端\u机密
等)的路由均不存在

如何创建新的应用程序并获取/设置我的
客户端id
客户端机密
重定向uri

我发现的一种方法(从
门卫::ApplicationController
)是

保存时将安全地生成
密码和
uid

我发现的一种方法(来自
Doorkeeper::ApplicationsController
)是

保存时将安全地生成
机密
uid

Doorkeeper::Application.create(name: "foobar", redirect_uri: "urn:ietf:wg:oauth:2.0:oob", scopes: ["read", "write"])