Sha256: f62fbb16191c775a53575c2024adf4fa75fc454e468d95b264859609b75d6ff2

Contents?: true

Size: 954 Bytes

Versions: 19

Compression:

Stored size: 954 Bytes

Contents

# Authentication

Authentication is enabled by calling `active_element.authenticate_with` from a controller, typically your `ApplicationController`, or some base controller used for a restricted namespace. `active_element.authenticate_with` receives a block which calls your chosen authentication framework's user authentication.


The recommended way to handle authentication with _ActiveElement_ is to use `prepend_before_action` which calls the authenticator:

```ruby
class ApplicationController < ActionController::Base
  prepend_before_action :configure_authentication

  private

  def configure_authentication
    active_element.authenticate_with { authenticate_user! }
  end
end
```

Passing the authenticator to _ActiveElement_ is optional and you are free to handle your own authentication, but allowing _ActiveElement_ to call the authenticator is required if you wish to utilize the [authorization model](access-control/authorization.html).

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
active_element-0.0.31 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.30 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.29 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.28 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.27 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.26 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.24 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.23 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.22 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.21 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.19 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.18 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.17 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.16 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.15 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.14 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.13 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.12 rspec-documentation/pages/020-Access Control/010-Authentication.md
active_element-0.0.11 rspec-documentation/pages/020-Access Control/010-Authentication.md