This function is a wrapper to create an httr::Token object for authentication with OAuth2/OpenID Connect.
Internally, it calls httr::oauth_app()
, httr::oauth_endpoint()
and httr::oauth2.0_token()
to create a token that can
then be used in fhir_search.
fhir_authenticate(
secret,
key,
base_url,
access,
authorize,
query_authorize_extra = list()
)
The consumer/client secret, belonging to key
.
Consumer key, also called client ID. For Keycloak this would for instance be the Keycloak client, e.g. "postman".
The URL the user will be redirected to after authorization is complete. This will usually be the base url of you FHIR server.
The url used to exchange unauthenticated for authenticated token.
This can be identical to authorize
.
The url to send the client for authorization.
A named list holding query parameters to append to initial auth page query. Could hold info about user identity and scope for keycloak like this:
list(scope = "openid",
grant_type = "password",
username = "fhir-user",
password = "fhirtest")