kohze / firedata Goto Github PK
View Code? Open in Web Editor NEWFirebase + R
License: MIT License
Firebase + R
License: MIT License
Hello Kohze.
Thanks for the great package. To work with it I had to make some minor changes, but in general, everything is working very good.
I have an issue after uploading data to realtime database: I need the variable to be true (Java logical), and it always return "true" (R character class). I have tried: changing the class to logical R (TRUE), factor R (level true), but none of them worked.
Do you know how can I do this through R?
Thanks a lot!
R.
Hi there,
I'm interested in knowing the status of this project. Wanting to connect to a Firebase DB and came across your project. Trying to decide if I roll my own or adopt your framework which looks good and provides the basic functionality I'm after.
Thanks in advance,
PC
There is always a random token such like "-LPfvzUEo8jkeAU56K2e" when I upload data to firebase database, is there any ways to change that?
It would be fantastic if you could extend the documentation a bit more thanks.
Currently trying to figure out how to get the upload/download functions to work with authentication. Seems like I might have the wrong access rules.
Hello,
When I run devtools::install_github("Kohze/fireData")
I get the following error:
* installing *source* package 'fireData' ...
** R
** byte-compile and prepare package for lazy loading
Error in parse(con, keep.source = FALSE, srcfile = NULL) :
26:23: unexpected symbol
25: export(upload_folder)
26: export(upload_storage)export
I can't seem to find a solution to this. I'm getting this same error in two different machines.
Thanks in advance for any help.
Hey,
i getting error "installing package DESCRIPTION failed for package 'fireData'" every time i try to install package.If i try to install from zip, error is same.
Can anyone help me with this problem?
Thanks.
Hi, this is an awesome and much needed package!
I'm having trouble with the upload. I tried it with and without a collection pre-defined ahead of time matching the data structure. No errors and the authentication succeeded.
if (!require("devtools")) install.packages("devtools")
devtools::install_github("Kohze/fireData")
library(fireData)
token <- anonymous_login(project_api = "sdfsdsds")
token
token$idToken
data(mtcars)
upload(x = mtcars,
projectURL = "https://afafer-asas.firebaseio.com/",
directory = "testing123")
Hi,
Would like to know how can we access data from Firebase if we are not storing data in the database?
We do not use the database currently and hence the projectURL and fileName parameter cannot be provided.
Regards
Ganesh Bhat
The version on CRAN of the package is telling me that its not available to work under r 3.4.4.
Is there any plans to updating the package for this support?
A question for each API package is how to store user logins. We might either go for the direction to let a (email = ... , password = ...) barely in the function, or require a pgp key that is created with a seperate function and stored in a system file.
Hello! I was wondering if there was a way to upload into the FireStore component of Firebase rather than the Realtime Database portion? I am using this package to automate data upload into the realtime database but also would like to upload data into the FireStore as well.
Due to a Google Firebase update the old Response = httr::POST(paste0(projectURL,"/",directory,".json?auth=",token), body = jsonlite::toJSON(output, auto_unbox = TRUE))
logic seems not to work anymore since it returns NULL
instead of the expected random key.
Since it is a core functionality to retrieve that randomKey we should fix it ASAP.
Hi,
I am attempting to us the function o_auth_login but keep getting an error saying that my IdP is invalid. My process is as follows:
Thanks so much for any help you can give!
Dear,
token looks ok but, but when I use upload function the response is only "main/" and nothing happens on firebase database. the same for put and patch
Token info:
$kind
[1] "identitytoolkit#VerifyPasswordResponse"
$localId
[1] "Ah8EANHjhqTL0u4sq3oGY5b0ySL2"
$email
[1] "[email protected]"
...
patch(x = mtcars, projectURL = "https://politia-768d3.firebaseio.com", directory = "main", token = Atoken$idToken)
[1] "main/"
I' trying to download a document using the idToken of a registerd user, but the response in the R console is "permission denied".
registered_user <- auth(api_key, email = "[email protected]", password = "newpassword")
download(projectURL = db_url, fileName = "upstream/-L3Keo2YcFEdMFXTbqu6",
token = registered_user$idToken)
When I try to repeat the process with cURL the message is more informative:
❯❯❯ curl -X POST -d '{"user_id" : "jack", "text" : "Ahoy!"}' \
'https://example.firebaseio.com/upstream.json?auth=<copy pasted idToken content>'
{
"error" : "Invalid claim 'kid' in auth header: '0uo_Iw' with iat: '1516489652'"
}
So after making sure to do this with a fresh token (updated iat values), I checked the idToken content on jwt.io and it contains the following:
Header:
{
"alg": "RS256",
"kid": "0uo_Iw"
}
Payload:
{
"iss": "https://identitytoolkit.google.com/",
"aud": "example",
"iat": 1516489652,
"exp": 1517699252,
"user_id": "KwM0oTcpF5h4RVDGObEmJkNl1St1",
"email": "[email protected]",
"sign_in_provider": "password",
"verified": false
}
This content seems different than the Firebase Custom Token content as outlined here. But I am not sure if that is the correct reference I'm looking at, or even if those custom tokens are required to get token-based access to work through the http API.
It could be that my rules are not correct. I am assuming that the generic rules:
{
"rules": {
".read": "auth != null",
".write": "auth != null"
}
}
is all that is needed to require token-based access in the calls, but perhaps that is were my mistake lies. If so I would appreciate if you could give me some example rules that would work.
I tried to generate a new API key and provided the same as shown below:
token <- anonymous_login(project_api = "new_API_key")
If I try to access token$idToken, I am getting NULL. Please find the content of token below:
$error
$error$code
[1] 400
$error$message
[1] "ADMIN_ONLY_OPERATION"
$error$errors
$error$errors[[1]]
$error$errors[[1]]$message
[1] "ADMIN_ONLY_OPERATION"
$error$errors[[1]]$domain
[1] "global"
$error$errors[[1]]$reason
[1] "invalid"
Can anyone please help me on this?
Thanks!
Is there any ways to aquire Authentication data in firebase?
I want to aquire data here :
https://imgur.com/vqYG3ox
project_api is called in auth()
, when it should be projectAPI
auth <- function(projectAPI, email="prompt", password="prompt"){
if (password == "prompt" && email == "prompt") {
email <- readline(prompt = "Email: ")
password <- readline(prompt = "Password: ")
print(paste0("Connecting to", project_api, ":"))
}
AuthUrl = paste0("https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=", projectAPI)
userData = httr::POST(url = AuthUrl, body = list("email" = email, "password" = password, "returnSecureToken" = "True"), encode = "json")
return(httr::content(userData))
}
I've been testing the upload function because for the longest time it was not working on my data.frame in R. From doing a ton of testing, it seems the function only works when all the data columns are numeric. Is this correct? How would I upload a data frame that includes character vectors?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.