is_authed_oidc_google: Google OAuth2.0 / OpenID Connect Strategy

Description Usage Arguments Value See Also Examples

Description

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'.

Usage

1
2
is_authed_oidc_google(req, res, token_location, client_id, hd = NULL,
  jwks_uri = "https://www.googleapis.com/oauth2/v3/certs")

Arguments

req

plumber request object

res

plumber response object

token_location

character. Location of token. Either "header" or "cookie". See get_token_from_req for details.

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.

Value

list with the following elements:

See Also

https://developers.google.com/identity/protocols/OpenIDConnect

Examples

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)

jandix/sealr documentation built on Oct. 3, 2021, 1:16 p.m.