Giter Club home page Giter Club logo

firedata's People

Contributors

kbmorales avatar kevinmcginleyorreco avatar kohze avatar paulsp94 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

firedata's Issues

Different classes on Realtime Database

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.

How it is:
image

How I want:
image

Do you know how can I do this through R?

Thanks a lot!

R.

Interested in status of this project

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

documentation

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.

Error during installation: Error in parse(con, keep.source = FALSE, srcfile = NULL)

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.

No data appears in Firebase

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")

Access data without Firebase Database

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

Available for r 3.4.4?

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?

Adding secure user logins

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.

Google FireStore upload

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.

upload response error

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.

Error 400: Invalid IdP when trying o_auth_login

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:

  1. I start with auth() to create login_token, and this works successfully.
    login_token <- auth(projectAPI = “API”, email = “email”, password = “password”)
  2. I attempt o_auth_login with the following information:
    project_api: The same as I used in auth()
    request_uri: the url listed under project_info.firebase_url in the JSON file of the site.
    post_body = login_token$idToken
    return_idp_credential=T
    When I attempt this a window opens with the following error messsage:
    Error 400: redirect_uri_mismatch
    The redirect URI in the request, http://localhost:1410/, does not match the ones authorized for the OAtuh client. To update the authorized redirect URIs, visit: (a google apis URL.)

Thanks so much for any help you can give!

functions response [1] "main/"

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/"

Cannot access data that requires authentication with idToken

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.

Not able to authenticate using project-api

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!

auth() calls wrong var for project API string

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))
}

Only able to upload numeric values?

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.