Description Usage Arguments Value See Also Examples
is_authed_oidc_google
checks whether a Google access token
obtained via Google's OpenID Connect (OIDC: an implementation of OAuth 2.0 for
authentication) passed as part of the HTTP request is valid.
The function can be passed to authenticate
's is_authed_fun
argument or it can be used standalone in any plumber endpoint.
is_authed_oidc_google
extracts the token from the HTTP Authorization header with the scheme 'bearer'.
1 2 | is_authed_oidc_google(req, res, token_location, client_id, hd = NULL,
jwks_uri = "https://www.googleapis.com/oauth2/v3/certs")
|
req |
plumber request object |
res |
plumber response object |
token_location |
character. Location of token. Either "header" or "cookie".
See |
client_id |
character. Google client ID. See docs for Google OpenID Connect |
hd |
character. hosted domain. Default NULL. See docs for Google OpenID Connect. |
jwks_uri |
character. JSON Web Key URI. See docs for Google OpenID Connect. |
list with the following elements:
is_authed: TRUE or FALSE. Result of the check whether the access token is valid.
status: character. Optional. Short description of HTTP status code.
code: integer. Optional. HTTP status code.
message: character. Optional. Longer description.
https://developers.google.com/identity/protocols/OpenIDConnect
1 2 3 4 5 6 7 8 | ## Not run:
pr$filter("sealr-openid-connect-google", function (req, res) {
sealr::authenticate(req = req, res = res,
is_authed_fun = is_authed_oidc_google,
client_id = Sys.getenv("GOOGLE_CLIENT_ID"))
})
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.