Radiator Server Documentation — v10.34.2
backends.http.@authentication
Table of Contents
authentication
This optional clause defines how Radiator authenticates to the HTTP service. Supported authentication methods include:
Basic authentication:
authentication basic {
# Both username and password parameter support
username "<username>";
password "<password>";
}
Bearer token authentication:
authentication bearer {
token "<api_token>";
}
The token value is an expression that Radiator evaluates for each backend
request, in the same way as the basic username and password values. Use
placeholders or accessors to send a token from the current request, for
example a token that the HTTP client sent in a cookie:
authentication bearer {
token "%{http.cookie.access_token}";
}
An unquoted expression such as token vars.access_token; also works.
Radiator sends the token in the Authorization: Bearer request header.
ApiKey authentication:
authentication header {
name "X-API-KEY";
value "<api_key>";
}
Oauth2 authentication:
authentication oauth2 {
device_url "https://login.microsoftonline.com/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/oauth2/v2.0/devicecode";
token_url "https://login.microsoftonline.com/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/oauth2/v2.0/token";
client "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
scope "user.read groupmember.read.all openid profile";
secret "client-secret-from-provider";
username "service-account@example.com";
password "service-account-password";
timeout 5s;
resource "https://graph.microsoft.com";
}
The authentication oauth2 block has the following optional parameters:
secret- Client secret used when the OAuth2 provider requires confidential client authentication.device_url- Device authorization endpoint used for device-code based OAuth2 flows.username- Username for providers that require resource-owner credentials or other username-based token requests.password- Password paired withusernamefor resource-owner credential style token requests.timeout- Request timeout for OAuth2 authentication calls.resource- Target resource or audience requested from providers that require an explicit resource parameter.