-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Two potential bugs regarding bookmarking apps? #60
Comments
Hi @pmoulos , thank you so much for the fixes! I tried to install the package and it did not install. Apparently, it has some parenthesis/curly braces missing. I've added them and successfully installed the package, but then I tried to run a simple app (the "logout" example) and it threw an error from Could you fix these please? Thanks again! |
Hi @jtrecenti, Sorry for the typos, it initially worked but seems I missed something from the comitted version. By the way, another thing that may need clarification in the docs is that if Thanks again for all the work. |
Hi @jtrecenti! |
Hi, actually I didn't have time to look at it carefully, sorry about that.
I'll manage to do so in the next few weeks
…On Mon, Feb 3, 2020, 02:38 Panagiotis Moulos ***@***.***> wrote:
Hi @jtrecenti <https://github.com/jtrecenti>!
Did you have the chance to review the latest changes?
Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#60?email_source=notifications&email_token=AAK4EMRBJDRWR7LN2CXENEDRA7X2ZA5CNFSM4KGGDVY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKTKUVY#issuecomment-581347927>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAK4EMXCP4UFTBDRWB437MTRA7X2ZANCNFSM4KGGDVYQ>
.
|
could this be related to #62? |
There is an issue though: somewhere in process URL parameters become URL-decoded and this breaks the URL. For example, try parameter like |
Hi folks, just one update. We've dug a lot into the bookmarking issue , which led us to this PR on shiny: rstudio/shiny#2880 We think that it would be the best way to go. We've also added a branch which fixes the bookmarking problem if the shiny PR is ever accepted. https://github.com/curso-r/auth0/tree/bookmark-gambi. We won't merge it into master until shiny maintainers consider this fix. Until then, it is possible to use bookmarking in a limited way, adding one observer that changes the input. Unfortunately, I don't think this is a stable solution, because it would need one to parse the input types correctly (for example, a checkbox should be parsed as a boolean). Here's a minimal example. library(shiny)
library(auth0)
ui <- function(request) {
fluidPage(
textInput("txt", "Enter text"),
verbatimTextOutput("out"),
bookmarkButton(),
logoutButton()
)
}
server <- function(input, output, session) {
## possible workaround without shiny PR
shiny::observe({
new_list <- shiny::parseQueryString(session$clientData$url_search)
# for each identified input
lapply(seq_along(new_list), function(ii) {
# remove extra quotation marks
val <- list(value = gsub("\"", "", new_list[[ii]]))
# updates the inputs
session$sendInputMessage(names(new_list)[ii], val)
})
})
output$out <- renderText({
input$txt
})
}
options(shiny.port = 8080)
enableBookmarking(store = "url")
shinyAppAuth0(ui, server) |
Hi,
Firstly, thanks for this excellent package! It made the whole auth0 setup so much easier and also gave ideas how to use
httr
with other authentication services.Now, I think I have identified, two, if not bugs, then potential enhancements:
When using bookmarks, Shiny adds
_state_id_
in the bookmark URL. If we then logout (through thelogout_url
function for example), the logout redirect URI that is created contains_state_id_
. If the user immediately logs back again, the previous bookmark is restored. I am not sure whether this is a desired behaviour. What if another user logs in with other credentials? Maybe I am missing some technical details here, but from my perspective this is not desirable and I implemented a fix by simply reconstructing the redirect URI without_state_id_
in.When using the
remote_url
parameter (in_auth0.yml
) for deployment in a remote server and enforcing local is not an option because it would complicate other things (e.g. when using Apachemod_proxy
to avoid displaying the Shiny port), bookmarks are not restored. Again, I 've implemented a fix/addition for this.I 've forked the package and implemented these fixes/additions. You can review here.
If you think it's ok I could create a PR?
Thanks again.
The text was updated successfully, but these errors were encountered: