forked from r-lib/httr2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
req_auth_bearer_token.Rd
35 lines (33 loc) · 1.05 KB
/
req_auth_bearer_token.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/req-auth.R
\name{req_auth_bearer_token}
\alias{req_auth_bearer_token}
\title{Authenticate request with bearer token}
\usage{
req_auth_bearer_token(req, token)
}
\arguments{
\item{req}{A \link{request}.}
\item{token}{A bearer token}
}
\value{
A modified HTTP \link{request}.
}
\description{
A bearer token gives the bearer access to confidential resources
(so you should keep them secure like you would with a user name and
password). They are usually produced by some large authentication scheme
(like the various OAuth 2.0 flows), but you are sometimes given then
directly.
}
\examples{
req <- request("http://example.com") \%>\% req_auth_bearer_token("sdaljsdf093lkfs")
req
# httr2 does its best to redact the Authorization header so that you don't
# accidentally reveal confidential data. Use `redact_headers` to reveal it:
print(req, redact_headers = FALSE)
}
\seealso{
\href{https://datatracker.ietf.org/doc/html/rfc6750}{RFC750}
The OAuth 2.0 Authorization Framework: Bearer Token Usage
}