Skip to content
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

Wordpress connection #58

Open
ugurdar opened this issue Jun 7, 2023 · 10 comments
Open

Wordpress connection #58

ugurdar opened this issue Jun 7, 2023 · 10 comments
Assignees

Comments

@ugurdar
Copy link

ugurdar commented Jun 7, 2023

Hi there,

I'm using firebase on my website. I have a button to redirect user to my shinyapp.

My problem is, user should login two time, 1. in website, 2. in app.

I wonder that is there any way to user login ones?

Thank you!

@JohnCoene
Copy link
Owner

If the website and the app share the same Firebase project they will only have to login once, in either place. That's one of the features of firebase.

@ugurdar
Copy link
Author

ugurdar commented Jun 7, 2023

website and app sharing same Firebase project and I created config file following this way:

firebase::firebase_config(
    api_key = "my-api-key", 
    project_id = "my-project-id"
)

@JohnCoene
Copy link
Owner

But what is the problem exactly?

@ugurdar
Copy link
Author

ugurdar commented Jun 7, 2023

In my wordpress website, when user logged in, can see the "Application" button. When clicked on the button, user see another page and there is Shiny app but should login one more time.
My problem is when user login in wordpress and click on Application button and come to Shiny app page i want to be able to access app directly instead of logging in again.

Do i need to handle this problem on wordpress side? Or can I generate a token when the user clicks this button and capture it using the Shiny firebase package?

Sorry if I'm asking a weird question, I'm very new to this wordpress and firebase stuff :/

@JohnCoene
Copy link
Owner

Firebase (and most auth services) will keep you signed in only on the same domain.
So if users sign in on on wordpress at mysite.com then go the app at app.mysite.com it will keep them sign in but if they go to anothersite.com it will not.

@ugurdar
Copy link
Author

ugurdar commented Jun 7, 2023

mysite.com -> app.mysite.com I'm following this but I hosted my app on app.fly.io with a docker container and directed to app.mysite.com I guess problem is here.

I thought this solution, when user click on the button it will create a token and save it in a database and redirect user with a app.myiste.com/?user_email=user@email&token=$token then Shiny app firstly control the database if user and token matched won't show firebase ui.

@JohnCoene
Copy link
Owner

That's strange it should work, not sure how the app is hosted is it on your actual domain or does it redirect?

@ugurdar
Copy link
Author

ugurdar commented Jun 8, 2023

I'm using fly.io server, I dockerized my app and hosted as myapp.fly.io and redirect to myapp.mysite.com

@JohnCoene
Copy link
Owner

Make sure you have authorised the domain on firebase console maybe

@ugurdar
Copy link
Author

ugurdar commented Jun 8, 2023

I authorised, I can login when I type my mail and password at myapp.mysite.com.

I don't how how actually it's work but is it possible to getting a login token from Firebase? and is the package allows getting that tokens before app start?

WP Sending Firebase Token to myapp.mysite.com with a query -> app observering token if token exist allows user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants