discourse/lib/auth
Blake Erickson f03b293e6a
FEATURE: Header based auth for API requests (#7129)
Now you can also make authenticated API requests by passing the
`api_key` and `api_username` in the HTTP header instead of query params.

The new header values are: `Api-key` and `Api-Username`.

Here is an example in cURL:

``` text
curl -i -sS -X POST "http://127.0.0.1:3000/categories" \
  -H "Content-Type: multipart/form-data;" \
  -H "Api-Key: 7aa202bec1ff70563bc0a3d102feac0a7dd2af96b5b772a9feaf27485f9d31a2" \
  -H "Api-Username: system" \
  -F "name=7c1c0ed93583cba7124b745d1bd56b32" \
  -F "color=49d9e9" \
  -F "text_color=f0fcfd"
```

There is also support for `Api-User-Id` and `Api-User-External-Id`
instead of specifying the username along with the key.
2019-03-08 09:13:31 -07:00
..
auth_provider.rb DEV: Reformat single line method definition 2018-12-03 15:03:00 +00:00
authenticator.rb FEATURE: List, revoke and reconnect associated accounts. Phase 1 (#6099) 2018-07-23 16:51:57 +01:00
current_user_provider.rb FIX: Do not check for suspicious login when impersonating. (#6534) 2018-11-12 15:34:12 +01:00
default_current_user_provider.rb FEATURE: Header based auth for API requests (#7129) 2019-03-08 09:13:31 -07:00
facebook_authenticator.rb REFACTOR: Migrate FacebookAuthenticator to use ManagedAuthenticator 2018-11-30 11:18:11 +00:00
github_authenticator.rb FIX: support connecting GitHub with existing accounts 2018-12-10 09:27:00 +11:00
google_oauth2_authenticator.rb REFACTOR: Migrate GoogleOAuth2Authenticator to use ManagedAuthenticator (#7120) 2019-03-07 11:31:04 +00:00
instagram_authenticator.rb REFACTOR: Migrate InstagramAuthenticator to use ManagedAuthenticator (#7081) 2019-03-04 14:54:28 +01:00
managed_authenticator.rb REFACTOR: Migrate GoogleOAuth2Authenticator to use ManagedAuthenticator (#7120) 2019-03-07 11:31:04 +00:00
oauth2_authenticator.rb FEATURE: List, revoke and reconnect associated accounts. Phase 1 (#6099) 2018-07-23 16:51:57 +01:00
open_id_authenticator.rb DEV: Fix build. 2018-11-05 14:16:03 +02:00
result.rb FEATURE: Use translated name for 'your email has been authenticated by' (#6649) 2018-11-22 19:12:04 +00:00
twitter_authenticator.rb REFACTOR: Migrate TwitterAuthenticator to use ManagedAuthenticator (#6739) 2018-12-07 15:39:06 +00:00