% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api.R
\name{af_auth}
\alias{af_auth}
\alias{af_auth_raw}
\alias{af_auth_bearer}
\alias{af_auth_header}
\alias{af_auth_query}
\title{Authentication strategies}
\usage{
af_auth_raw(header = "Authorization")

af_auth_bearer(header = "Authorization", prefix = "Bearer ")

af_auth_header(header = "X-API-Key")

af_auth_query(param = "api_key")
}
\arguments{
\item{header}{Header name to use.}

\item{prefix}{String prepended to the token (bearer scheme).}

\item{param}{Query-parameter name (query scheme).}
}
\value{
An \code{apifetch_auth} object.
}
\description{
Constructors describing how a token is attached to a request. Pass the result
to the \code{auth} argument of \code{\link[=af_api]{af_api()}}.
}
\details{
\itemize{
\item \code{af_auth_raw()}: send the token verbatim in a header (default
\code{Authorization}). This is what the Big Data PE API expects.
\item \code{af_auth_bearer()}: send \code{"Bearer <token>"} in the \code{Authorization} header.
\item \code{af_auth_header()}: send the token in an arbitrary header (e.g.
\code{X-API-Key}).
\item \code{af_auth_query()}: send the token as a URL query parameter.
}
}
\examples{
af_auth_raw()
af_auth_bearer()
af_auth_header("X-API-Key")
af_auth_query("api_key")
}
