# test-auth.R
testthat::test_that('Authorization', {
# base64 encode using openssl
access_key <- 'access_key'
user <- 'username'
pw <- 'password'
auth_header <- openssl::base64_encode(paste0(access_key, "+", user, ":", pw))
testthat::expect_length(auth_header, 1)
httr_header <- httr::add_headers('Authorization' = paste0('Basic ', auth_header))
testthat::expect_length(httr_header, 7)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.