Reputation: 97
I am trying to create a simple shiny app that is connected to the Auth0 password system using the Auth0 library. Currently, I am just trying to run locally. I get an Auth0 page that says 'there could be a misconfiguration in the system or a service outage' when I try to run, but I can't figure out why. I took the following steps:
Any thoughts?
Upvotes: 1
Views: 3552
Reputation: 1
I was also facing the same problem and getting the same error again and again whenever I tried to log in through it. But, now I find the solution and it works for me. Solution:
Currently, auth0 has changed their way to write the 'clientID' and 'domain' names, etc. Earlier, they were writing in the following way:
<Auth0Provider
domain="dev-12334556767.us.auth0.com"
clientId="abdgcfdhdfhjgjrbubrfubhbure"
redirect_uri: window.location.origin
>
<AppProvider>
<App />
</AppProvider>
</Auth0Provider>
But, now things have changed now, and follow this below pattern to write the configuration of auth0:
<Auth0Provider
domain="dev-12334556767.us.auth0.com"
clientId="abdgcfdhdfhjgjrbubrfubhbure"
authorizationParams={{
redirect_uri: window.location.origin
}}
>
<AppProvider>
<App />
</AppProvider>
</Auth0Provider>
I hope this will work for everyone. Thanks
Upvotes: 0
Reputation: 2227
A similar problem that happened to have the same solution as @Hattie35's. I'm putting it here just in case someone else comes across it.
I was about to ask the question here on StackOverflow when @Hattie35's question popped up in the suggestions.
Here you go:
I'm trying to implement authentication to my R Shiny app using the {auth0} package.
I have followed the documentation step by step for around 10 times now but I keep getting the same error on my browser when I run the application:
Unknown host: thetechie.auth0.com
Nothing else shows on the page.
Has anyone else encountered this before? What might I be missing? I'd really appreciate any pointers in the right direction.
app.R
:
options(shiny.port = 8085)
library(shiny)
ui <- fluidPage(
fluidRow(
plotOutput("plot")
)
)
server <- function(input, output, session) {
output$plot <- renderPlot({
plot(1:10)
})
}
auth0::shinyAppAuth0(ui, server)
_auth0.yml
:
name: myApp
remote_url: ''
auth0_config:
api_url: !expr paste0('https://', Sys.getenv('AUTH0_USER'), '.auth0.com')
credentials:
key: !expr Sys.getenv("AUTH0_KEY")
secret: !expr Sys.getenv("AUTH0_SECRET")
.Renviron
:
AUTH0_USER=thetechie
AUTH0_KEY=ClientId
AUTH0_SECRET=ClientSecret
Allowed Callback URLs, Allowed Logout URLs and Allowed Web Origins are all:
http://localhost:8085/
As @Hattie35 suggested, edit the autogenerated _auth0.yml
and add the region "part" to the api_url
:
name: myApp
remote_url: ''
auth0_config:
api_url: !expr paste0('https://', Sys.getenv('AUTH0_USER'), '.us.auth0.com')
credentials:
key: !expr Sys.getenv("AUTH0_KEY")
secret: !expr Sys.getenv("AUTH0_SECRET")
Upvotes: 0
Reputation: 97
Update: I finally figured out what I was doing wrong. I was setting the api_url to be https://[my_name].auth0.com instead of https://[my_name].us.auth0.com. So if you use the autogenerated YML and the US url make sure to change that.
Upvotes: 2