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

Description Usage Arguments Value See Also Examples

Description

Returns the authentication parameter "code" in redirected URLs

Usage

1
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

 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=shinygaGetTokenURL(securityCode)
          )
       })

  AccessToken <- reactive({
      validate(
        need(AuthCode(), "Authenticate To See")
      )

      access_token <- shinygaGetToken(code = AuthCode())

      token <- access_token$access_token

    })
}

## End(Not run)

MarkEdmondson1234/shinyga documentation built on May 7, 2019, 3:34 p.m.