firebase-admin

Managing Session Cookies with Firebase and Electron

泪湿孤枕 提交于 2021-01-27 13:34:08
问题 I am trying to set up session cookies in my Node server, which is the backend for an Electron app. I am trying to follow this guide. https://firebase.google.com/docs/auth/admin/manage-cookies The first thing I am confused about is where this function comes from in the "Sign In" section: const csrfToken = getCookie('csrfToken') Is 'getCookie' a function I am supposed to write myself? I am also not fully following the logic of the "create session cookie" snippet: const csrfToken = req.body

Managing Session Cookies with Firebase and Electron

不羁岁月 提交于 2021-01-27 13:24:29
问题 I am trying to set up session cookies in my Node server, which is the backend for an Electron app. I am trying to follow this guide. https://firebase.google.com/docs/auth/admin/manage-cookies The first thing I am confused about is where this function comes from in the "Sign In" section: const csrfToken = getCookie('csrfToken') Is 'getCookie' a function I am supposed to write myself? I am also not fully following the logic of the "create session cookie" snippet: const csrfToken = req.body

Firebase admin how to create user with passwordless signin?

自作多情 提交于 2021-01-05 09:46:17
问题 I am looking at the following docs to create a user using the Node.js Firebase admin SDK: https://firebase.google.com/docs/auth/admin/manage-users#create_a_user However, I want to create a user with passwordless (email link) sign-in, not with a password. Is this possible? What happens if I don't specify a password for the user? My web-app currently uses passwordless signin, so it works normally. 回答1: I just tested and figured it out. If you don't set a password for the user, the user will not

Firebase auth user.getIdToken() sending expired tokens

自古美人都是妖i 提交于 2020-12-13 06:40:42
问题 As far as I know, getIdToken() should by default send an unexpired token to the server, handling the token refreshing internally. However, I am getting many many errors from my server regarding expired tokens. On my frontend, I created axios instance as follows: const base = axios.create({ baseURL: apiUrl, }); base.interceptors.request.use(async (config) => { const token = await getAccessToken(); config.headers.Authorization = `Bearer ${token}`; return config; }); const getAccessToken = async

Firebase auth user.getIdToken() sending expired tokens

前提是你 提交于 2020-12-13 06:39:04
问题 As far as I know, getIdToken() should by default send an unexpired token to the server, handling the token refreshing internally. However, I am getting many many errors from my server regarding expired tokens. On my frontend, I created axios instance as follows: const base = axios.create({ baseURL: apiUrl, }); base.interceptors.request.use(async (config) => { const token = await getAccessToken(); config.headers.Authorization = `Bearer ${token}`; return config; }); const getAccessToken = async

Firebase Token Authentication using Django

我是研究僧i 提交于 2020-12-06 06:54:47
问题 I am new to django and am trying to get the user authenticated using firebase admin sdk. I am trying to do token authentication and have setup the admin sdk in my django app. Also I have received the client id token in the android app. Now I am unable to understand how to send this id to the backend and verify it as a user and create users accordingly.I did find this answer but couldn't really understand how to go about this. Also if a user is verified how do I add and update its data. Do I