Description Usage Arguments Value See Also Examples
Once a user browses to ShinyGetTokenURL and is redirected back with request shinygaGetToken takes that code and returns a token needed for Google APIs Uses the same client.id and client.secret as ShinyGetTokenURL
1 2 | shinygaGetToken(code, client.id = CLIENT_ID, client.secret = CLIENT_SECRET,
redirect.uri = CLIENT_URL)
|
code |
The code passed from AuthCode(). |
client.id |
The client ID taken from the Google API Console. |
client.secret |
The client secret taken from the Google API Console. |
redirect.uri |
The URL of where your Shiny application sits, that will read state parameter. |
The token from Google that authenticates future API calls.
Shortcut using doAuthMacro
.
Other authentication functions: authReturnCode
;
createCode
; doAuthMacro
;
shinygaGetTokenURL
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 | ## Not run:
securityCode <- createCode()
shinyServer(function(input, output, session)){
AuthCode <- reactive({
authReturnCode(session, securityCode)
})
output$AuthGAURL <- renderUI({
a("Click Here to Authorise Your Google Analytics Access",
href=ShinyGetTokenURL(securityCode)
)
})
AccessToken <- reactive({
validate(
need(AuthCode(), "Authenticate To See")
)
access_token <- ShinyGetToken(code = AuthCode())
token <- access_token$access_token
})
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.