polymerfire | Polymer Web Components for Firebase | Web Framework library
kandi X-RAY | polymerfire Summary
kandi X-RAY | polymerfire Summary
Polymer Web Components for Firebase
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of polymerfire
polymerfire Key Features
polymerfire Examples and Code Snippets
Community Discussions
Trending Discussions on polymerfire
QUESTION
I'm building an app in witch the user see a set of downsized images and than press " ok" for the app to download all of the original files, put them into a zip file and send the zip file.
the app is using polymer, polymerfire, firebase (including the storage).
during the upload of the images i save in the database both the download url and the storage reference for both the original file and the downsized one.
when i put the download url in the iron-image element to show the images in the browser everything works perfectly, the downsized images are shown on the screen. When i try to download the fullsize images via XMLHttpRequest() i get the Cors error. I can't understand why, both request are coming from the same app, why two different cors response?
here is the code for the XMLHttpRequest() (mostly copied from the firebase documentation):
...ANSWER
Answered 2017-Feb-04 at 13:18The section on headers in the Firebase “Deployment Configuration” documentation indicates that to enable cross-origin requests for images, you must add to your firebase.json
something like this:
QUESTION
I am creating a web app with polymer and firebase, and I want be able to merge anonymously logged in accounts to be able to merge to an email and password account.
I found the official documentation on how to achieve this https://firebase.google.com/docs/auth/web/anonymous-auth , but when I try it out, it does not work.
Documentation provides the code sample
...ANSWER
Answered 2017-Jul-10 at 02:27Polymer's firebase-auth element has an auth property. So you could bind to it:
QUESTION
I want to modify this Notes app to work with email/password logins instead of using google accounts:
Build a Progressive Web App with Firebase, Polymerfire and Polymer Components
...ANSWER
Answered 2018-Sep-19 at 01:31I'm using this:
QUESTION
So I'm using this method saveValue and only using the path parameter. The method is generating a unique key and data is stored while I'm inserting text in my input fields...
My question now is: How can I get to know what the new key is?
Regards, Peter
...ANSWER
Answered 2018-Jul-17 at 01:29This is an old question but I just came across this issue. The answer is that the new path is saved to the path property of the firebase-document used to call saveValue.
QUESTION
I want to display my data in reverse chronological order of how/when it was entered. In other words, I want the most recent entries to appear at the top.
I am using Polymerfire to fetch data from my Firebase/Polymer app and I am using
to display the data. Currently, the list has the most recent entries at the bottom of the list.
I expect that reversing the order in either or
should result in the desired behavior. I prefer to accomplish this without using the
items.reverse()
method. Are there any properties or methods native toiron-list
or Polymerfire to accomplish the desired behavior?
ANSWER
Answered 2018-Jun-14 at 03:53As far as I know (and could quickly check in the PolymerFire source code for its query
component) there is nothing built into the library for reversing the items from the database.
The remaining option is to add an additional property to your database nodes with the inverted value of the property you want to sort on. So in your case that could be an inverted timestamp: -1 * Date.now()
. If you then sort on this inverted value, the results will show up in descending order of the original timestamp.
QUESTION
I want to implement to fetch and apply user settings. I am using this page as a guide.
When I load the page with no data at the /users/{{userId}}/settings
node in my firebase, I expect to see the object { new: 'initial', j: 5, o: 'N' })
loaded there. However, I actually see no change to the node in my firebase.
What am I doing wrong and how can I achieve my desired bahavior?
settings.html ...ANSWER
Answered 2018-Mar-16 at 20:54As you mentioned above that there is no data at the path, then you need to change if conditions. Something like:
QUESTION
Polymer PWA app works perfectly fine in MacBook Chrome, Windows Chrome, Android Chrome browser but shows blank screen in MacBook Safari, iPhone Safari and iPhone Chrome.
Zero Errors or Zero warnings shown in web inspector.
HTML page - index.html
...ANSWER
Answered 2017-Nov-11 at 11:16Google Chrome is currently the only browser that has a native support for web components features (templates, HTML imports, custom elements and shadow DOM). For the other browsers you need to include a polyfill (webcomponentsjs) before importing any web component.
QUESTION
I have written a simple web app hosted in Firebase and using Firebase Functions (for API layer) and Firebase Authentication to manage and authenticate users. The web client layer is written using Polymer including Polymerfire and is using to handle user auth. I only accept Google ids for users.
The drawing below gives some more details.
Web Client Flow:
- The user is authenticated through
> tag using with the Firebase Authentication component
- A REST call is made to create or update a record passing the idToken from the user object
- The API Function verifies the idToken from Firebase Authentication
- Data is updated in the database
I've read all the documentation and many SO posts (including Linking Google Assistant with Firebase Auth about implementing Account Linking for AoG/Dialogflow, but I am thoroughly confused. The material I've found assumes a level of knowledge I don't have and I can't seem to acquire :-)
I would like to use:
- Implicit Flow
- Streamlined Identity Flow
- V1 Webhook protocol (because it has a getUser function; V2 does not)
Can anyone direct me to documentation, tutorial, or sample application that can provide clear instructions to achieve this?
...ANSWER
Answered 2018-Jan-18 at 03:27The problem is that there are few clear tutorials for how to do this because every authorization situation is different. It is compounded in your case because you're not really looking for authorization - you're looking for authentication. But Google and the Assistant need to treat this as authorization. Specifically - they want to make sure that the user on their end of the Google Home is authorized to access your service.
This process is called Account Linking in Google's documentation. You're linking a Google Assistant user to your user account system.
To do this, they're going to use OAuth... but backwards from how you're currently using it. In your current model, your web client uses OAuth (through the Google Login) to get the authorization through Google's servers. But with the Assistant - the Assistant is the client, and it needs to get that authorization through your server.
Here is an update to your diagram that tries to illustrate this, although this is simplified a bit. Google's documentation gives step-by-step implementation requirements, although it can't give any details or code since those are dependent on your needs. The numbers refer to each step, which I talk about below.
Your user has triggered your Action, or a step in your Action, that requires authorization. All requests go through Google's server (before hitting Dialogflow), and it knows if it will need to provide that authorization information.
If it already has authorization, we can skip to step 6.
If it doesn't already have authorization, it will contact your OAuth server at an authorization page that you've configured. It does this by directing your user to open the Home app, which will redirect the user to that authorization page. Skip to step 3.
If it had authorization, but that authorization has expired, it will contact your OAuth server at the token exchange point to exchange a refresh token for an auth token. Skip to step 4.
The user will likely need to sign-in and your server will need to authenticate them (a bunch of arrows that mirror what your web-app is doing, so I omitted them). Typically, you'll also explicitly make sure that the user is authorizing the Google Assistant to have access to their resources on your service. (Google shows OAuth screens all the times for third-parties getting access to your resources stored on Google. You've probably seen them.) Your auth server needs to send back a limited-use code which we'll exchange for a refresh token and auth token shortly.
Your auth server now gets either a refresh token or an access code (depending on what happened in steps 2 and 3). Your server then needs to take this, verify that it is valid, and then generate an auth token (and, if this is the first time, a refresh token.) When you verify it, you'll likely be consulting your user database, possibly to store the tokens, but certainly to make sure the user is still a user.
You'll then return the auth token (and possibly refresh token) to Google's servers. They'll store these tokens - the refresh token indefinitely, and the auth token for the lifetime of the token.
For each request, Google will pass the auth token to Dialogflow...
...which will pass it on in the JSON body to the webhook.
Your webhook will then need to get this auth token out of the JSON body (or by using
app.getUser()
) and convert it to the ID you need. One way to do this is to have an API in your auth server that takes the auth token and returns the ID. Or you may be able to look it up in the database directly, if you're using a shared user database. Or the auth token may be a signed JWT and, once you've verified the signature is from your auth server, you can use the id that is included in the JWT.You can then proceed as you've outlined.
I've used the Authorization Code Flow for this for a few reasons:
It is more secure than the Implicit flow.
It is not significantly more complex to implement.
The thing that does make it more complex (the code exchange endpoint) is required if you want to do the "Simplified"/"Streamlined" Identity Flow, which allows users to sign-up to your service if they haven't already done so.
I do not go into the additional requirements to get the Streamlined Flow working. Get the above working first and then follow the directions to add the streamlined account creation, which mostly involve extra work at stage 2, 4, and 5.
QUESTION
I have an app that will log in with firebase. I'm using polymerfire for this. Got an main app element: my-app
that has these children:
ANSWER
Answered 2017-May-22 at 10:51You can do it different way. Thanks to events and listeners you will be able to propagate some event to parent and then in parent-element just access firebase-auth using this.$.auth
.
So:
at my-home
element when you are ready to call firebase auth, just call somethind like: this.fire("logIn");
and in parent-elemet inside a ready
function write this:
QUESTION
I am using polymer and firebase to create a web app. To get a list in the database, I am using the "firebase-query" element of polymerfire.
Now, the list of items I am getting from the database is posts that people are posting on my app. Now I have the firebase-query element like this:
...ANSWER
Answered 2017-May-31 at 14:28I am not familiar with firebase-query, but you can do simple trick. On property posts
set observer
function.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install polymerfire
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page