You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting missing_credentials? error. The request.params is always an empty hash even though I provide username and password in the request body via POST method. I can see the body params when debugging actual controller, but it looks like those params are not passed to omniauth request.
Is POST and Rails API supported - I am not sure if I should continue searching for a solution in my code (spent already a week on that) or this is a bug/out of scope of the current implementation.
Controller:
module Api
module V1
module Auth
class OmniauthCallbacksController < Devise::OmniauthCallbacksController #< ApplicationController#
include ActionController::Cookies
def ldap
puts request.env['omniauth.auth'] # => NULL
end
def failure
puts "request.env['omniauth.auth']: #{request.env['omniauth.auth']}" # => NULL
puts "request.env['omniauth.params']: #{request.env['omniauth.params']}" # => {}
puts "params: #{params}" # => { "username": "myusername", "password": "mypassword" }
render json: { status: "fail" }
end
end
end
end
end
Configuration
omniauth-ldap
2.7.4 (Rails API only)
Rails 6.0.4.1
Ubuntu
Expected Behavior
Authenticate using LDAP provider
Actual Behavior
Getting missing_credentials? error. The request.params is always an empty hash even though I provide username and password in the request body via POST method. I can see the body params when debugging actual controller, but it looks like those params are not passed to omniauth request.
Is POST and Rails API supported - I am not sure if I should continue searching for a solution in my code (spent already a week on that) or this is a bug/out of scope of the current implementation.
Controller:
Application.rb:
Routes.rb:
devise_for :users, controllers: { omniauth_callbacks: 'api/v1/auth/omniauth_callbacks' }
Devise:
Response:
The text was updated successfully, but these errors were encountered: