| guard_beeceptor | R Documentation |
These two functions sets up mock OAuth 2.0 guards based on tools provided by Beeceptor. They should obviously not be used for production because they allow anyone to be authenticated, but they can be used while testing your authentication setup.
guard_beeceptor_github(
redirect_url,
client_id = "MOCK_CLIENT",
...,
name = "beeceptor_github"
)
guard_beeceptor_google(
redirect_url,
client_id = "MOCK_CLIENT",
...,
name = "beeceptor_google"
)
redirect_url |
The URL the authorization server should redirect to following a successful authorization. Must be equivalent to one provided when registering your application |
client_id |
The ID issued by the authorization server when registering your application |
... |
Arguments passed on to
|
name |
The name of the guard |
A GuardOAuth2 object
beeceptor <- guard_beeceptor_github(
redirect_url = "https://example.com/auth"
)
# Add it to a fireproof plugin
fp <- Fireproof$new()
fp$add_guard(beeceptor, "beeceptor_auth")
# Use it in an endpoint
fp$add_auth("get", "/*", beeceptor_auth)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.