Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.
/ AppIdR Public archive

Package to get authentication with App ID IBM service in the Shiny Apps.

License

Notifications You must be signed in to change notification settings

IBM/AppIdR

Repository files navigation

AppIdR

Lifecycle: experimental R build status

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

Install

remotes::install_github("IBM/AppIdR")

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") # clientId
  secret: !expr Sys.getenv("APPID_SECRET") # secret
  redirect_uri: !expr Sys.getenv("APP_URL") # app url
  base_url: !expr Sys.getenv("APPID_URL") # oAuthServerUrl
  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(AppIdR)

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 using Auth0 service curso-r/auth0
  2. Gist with Sketch of Shiny + Oauth hadley/shiny-oauth.r

About

Package to get authentication with App ID IBM service in the Shiny Apps.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages