Class: TwoPercent::ApplicationController

Inherits:
ActionController::API
  • Object
show all
Defined in:
app/controllers/two_percent/application_controller.rb

Direct Known Subclasses

BulkController, ScimController

Instance Method Summary collapse

Instance Method Details

#authenticateObject



12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/two_percent/application_controller.rb', line 12

def authenticate
  result = instance_exec(&TwoPercent.config.authenticate)

  return if result

  render_scim_error(
    status: :unauthorized,
    scim_type: nil, # RFC 7644: No scimType for 401
    detail: "Authentication failed"
  )
end