Learn R Programming

shinyga (version 0.1.2.9001)

authReturnCode: Returns the authentication parameter "code" in redirected URLs

Description

Returns the authentication parameter "code" in redirected URLs

Usage

authReturnCode(session, securityCode)

Arguments

session
A session object within a shinyServer function.
securityCode
A randomly generate security code passed previously in shinygaGetTokenURL.

Value

The authentication code from the redirect URL parameter.

See Also

Shortcut using doAuthMacro.

Other authentication functions: createCode; doAuthMacro; shinygaGetTokenURL; shinygaGetToken

Examples

Run this code
## 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=shinygaGetTokenURL(securityCode)
#           )
#        })
# 
#   AccessToken <- reactive({
#       validate(
#         need(AuthCode(), "Authenticate To See")
#       )
# 
#       access_token <- shinygaGetToken(code = AuthCode())
# 
#       token <- access_token$access_token
# 
#     })
# }
# ## End(Not run)

Run the code above in your browser using DataLab