Learn R Programming

shinyga (version 0.1.2.9001)

createCode: Creates a random character code

Description

Creates a random character code

Usage

createCode(seed = NULL, num = 20)

Arguments

seed
The seed for random code.
num
Number of characters in code.

Value

A random string of digits and characters.

See Also

Shortcut using doAuthMacro.

Other authentication functions: authReturnCode; 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