README.md

appId

Lifecycle:
experimental R build
status

THIS REPOSITORY HAS BEEN ARCHIVED, BUT A NEW ONE IS HERE: https://github.com/IBM/AppIdR

The appId is a package to get authentication with App ID IBM service in the Shiny Apps.

Install

remotes::install_github("th1460/appId")

Configure

In the first, you need generate a config yaml file with:

gen_appid_config(name = "Myapp")

And resulting

# appid_config.yml

name: Myapp
config:
  key: !expr Sys.getenv("APPID_KEY")
  secret: !expr Sys.getenv("APPID_SECRET")
  redirect_uri: !expr Sys.getenv("APP_URL")
  base_url: !expr Sys.getenv("APPID_URL")
  authorize: authorization
  access: token
  scope: openid
  password: !expr Sys.getenv("SECRET") # encrypt token

You should too, create a .Renviron file with the credentials.

Example

require(shiny)
require(shinydashboard)
require(appId)

ui <- dashboardPage(
  dashboardHeader(user_info(), # show user info
                  title = "My dashboard"),
  dashboardSidebar(),
  dashboardBody()
)

server <- function(input, output, session) {

  # if you want get user info in app
  userinfo <- callModule(get_user_info, "userinfo")
  output$user <- renderText({userinfo()})

}

# modified shinyApp
shinyAppId(ui, server)

References

  1. Package curso-r/auth0
  2. Gist hadley/shiny-oauth.r


th1460/appId documentation built on May 22, 2021, 9:52 a.m.