iosアプリ用のAPIを作成していて、rails4 devise doorkeeperでユーザー認証を実装しようとしているんですが、アクセストークンの発行がうまくいかずはまっております。
postmanでAPIを叩くと
"error": "unsupported_grant_type", "error_description": "The authorization grant type is not supported by the authorization server."
と言うエラーを返してくれるんですが、解決の糸口が見えず、困っています!
どなたかご存知の方教えていただけないでしょうか?
Started POST "/oauth/token" for ::1 at 2016-10-08 19:42:06 +0900 ActiveRecord::SchemaMigration Load (1.1ms) SELECT "schema_migrations".* FROM "schema_migrations" Processing by Doorkeeper::TokensController#create as */* Parameters: {"grant_type"=>"password", "password"=>"[FILTERED]", "email"=>"sample@gmail.com"} Completed 401 Unauthorized in 39ms
[18] pry(main)> access_token = client.password.get_token('sample@gmail.com', 'password') OAuth2::Error: unsupported_grant_type: The authorization grant type is not supported by the authorization server. {"error":"unsupported_grant_type","error_description":"The authorization grant type is not supported by the authorization server."}
initializer/doorkeeper.rb
resource_owner_authenticator do current_user || warden.authenticate!(scope: :user) end Doorkeeper.configuration.token_grant_types << "password"
おそらく下記のようなエラーが出るのでdookeeper.rbのコードが間違ってると思うんですが、
Resource Owner Password Credentials flow failed due to Doorkeeper.configure.resource_owner_from_credentials being unconfigured.
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。