Sha256: d0648209fdd3fcf5e232fd1716b0b3d5af07abf22373c5c8c23cc362c85fda28

Contents?: true

Size: 703 Bytes

Versions: 46

Compression:

Stored size: 703 Bytes

Contents

# Authentication Interceptor

Add the auth interceptor to your basic set of LHC interceptors.

```ruby
  LHC.config.interceptors = [LHC::Auth]
```

## Bearer Authentication

```ruby
  LHC.get('http://local.ch', auth: { bearer: -> { access_token } })
```

Adds the following header to the request:
```
  'Authorization': 'Bearer 123456'
```

Assuming the method `access_token` responds on runtime of the request with `123456`.

## Basic Authentication

```ruby
  LHC.get('http://local.ch', auth: { basic: { username: 'steve', password: 'can' } })
```

Adds the following header to the request:
```
  'Authorization': 'Basic c3RldmU6Y2Fu'
```

Which is the base64 encoded credentials "username:password".

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
lhc-9.2.0 docs/interceptors/authentication.md
lhc-9.1.2 docs/interceptors/authentication.md
lhc-9.1.2.pre docs/interceptors/authentication.md
lhc-9.1.1 docs/interceptors/authentication.md
lhc-8.1.1 docs/interceptors/authentication.md
lhc-9.1.0 docs/interceptors/authentication.md
lhc-9.0.0 docs/interceptors/authentication.md
lhc-8.1.0 docs/interceptors/authentication.md
lhc-8.0.0 docs/interceptors/authentication.md
lhc-7.3.3 docs/interceptors/authentication.md
lhc-7.3.2 docs/interceptors/authentication.md
lhc-7.3.1 docs/interceptors/authentication.md
lhc-7.3.0 docs/interceptors/authentication.md
lhc-7.2.0 docs/interceptors/authentication.md
lhc-7.1.0 docs/interceptors/authentication.md
lhc-7.0.1 docs/interceptors/authentication.md
lhc-7.0.0 docs/interceptors/authentication.md
lhc-7.0.0.beta1 docs/interceptors/authentication.md
lhc-6.7.2 docs/interceptors/authentication.md
lhc-6.7.1 docs/interceptors/authentication.md