refresh-token

How do I use oauth2 and refresh tokens with the google api?

喜你入骨 提交于 2019-12-03 03:10:16
So I just spent the last few days trying to figure this out and am asking this question so that I can answer it for other people who are having problems. First, the google documentation is TERRIBLE and uses different oauth2 libraries depending on which of the many google API examples you are looking at. It is often self-contradictory and sometimes straight up has code in it that doesn't work. Oh well. so my questions were basically: how do I use the google api libraries to have my users grant me access to their google accounts? how do I store the oauth2 access tokens that google returns so

How do I access my Firebase Database via HTTP REST API?

蹲街弑〆低调 提交于 2019-12-02 15:59:58
Thanks to this answer I am able to connect to Firebase 3 via HTTP REST API and an email/password. Logging in with this API returns an access token that is used to access the Firebase Database. This access token expires after 1 hour. A refresh token is also returned after logging in, which I can use to refresh my access token. Here is what I am doing specifically: Method: POST URL: https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=<my-firebase-api-key> Payload: { email: "<email>", password: "<password>", returnSecureToken: true } Response: { "kind": "identitytoolkit

Firebase refresh-token expiration

有些话、适合烂在心里 提交于 2019-12-02 00:45:08
问题 While testing the security of one of our product, a web application, using the REST API of Firebase we got surprised when we realised that refresh-tokens never expire in the V3 of the Firebase implementation, allowing any refresh-token to create new tokens forever . While local-storage seem a reasonably safe solution today, we are concerned by the possibility that it could fail tomorrow , even for a short amount of time, and that we cannot stop someone from using any of these refresh-tokens.

Firebase refresh-token expiration

心不动则不痛 提交于 2019-12-01 21:29:45
While testing the security of one of our product, a web application, using the REST API of Firebase we got surprised when we realised that refresh-tokens never expire in the V3 of the Firebase implementation, allowing any refresh-token to create new tokens forever . While local-storage seem a reasonably safe solution today, we are concerned by the possibility that it could fail tomorrow , even for a short amount of time, and that we cannot stop someone from using any of these refresh-tokens. Two factor authentication will help mitigate the issue, but the first step would become compromised

IdentityServer4 - How to store refresh token into database using mysql.data?

我的梦境 提交于 2019-12-01 17:26:07
问题 I'm new at IdentityServer4. I read I need to implement an IPersistedGrantStore to store refresh tokens into a table like PersistedGrants in my database. IdentityServer logs is the following when my native app ask for a new access token: "refresh_token" grant with value: "{value}" not found in store . That's because I'm using in-memory version of the persisted grant store. So I need to store refresh token in a PersistedGrant table. Therefore in my startup.cs I added the following line: builder

what's the point of refresh token?

半城伤御伤魂 提交于 2019-11-29 22:08:01
i have to confess i've had this question for a very long time, never really understand. say auth token is like a key to a safe, when it expires it's not usable anymore. now we're given a magic refresh token, which can be used to get another usable key, and another... until the magic key expires. so why not just set the expiration of the auth token as the same as refresh token? why bother at all? what's the valid reason for it, maybe a historical one? really want to know. thanks Ryan Boyd The referenced answer (via @Anders) is helpful, It states: In case of compromise, the time window it's

What is the purpose of a “Refresh Token”?

点点圈 提交于 2019-11-28 22:54:40
I have a program that integrates with the YouTube Live Streaming API. It runs on timers, so its been relatively easy for me to program in to fetch a new Access Token every 50 minutes with a Refresh Token. My question is, why? When I authenticated with YouTube, it gave me a Refresh Token. I then use this refresh token to get a new Access Token about once an hour. If I have the Refresh Token, I can ALWAYS use this to get a new Access Token, since it never expires. So I don't see how this is any more secure than just giving me an Access Token from the start and not bothering with the whole

what's the point of refresh token?

那年仲夏 提交于 2019-11-28 17:23:21
问题 i have to confess i've had this question for a very long time, never really understand. say auth token is like a key to a safe, when it expires it's not usable anymore. now we're given a magic refresh token, which can be used to get another usable key, and another... until the magic key expires. so why not just set the expiration of the auth token as the same as refresh token? why bother at all? what's the valid reason for it, maybe a historical one? really want to know. thanks 回答1: The

Should I explicitly send the Refresh Token to get a new Access Token - JWT

馋奶兔 提交于 2019-11-27 08:42:24
In my application, I return an access token and a refresh token when a user logs in successfully. The expiration times for access and refresh token have been set to 10 and 40 minutes respectively. (I should do some more research on those values. This is just for testing) I used the implementation described in following article http://www.svlada.com/jwt-token-authentication-with-spring-boot/ Let's say I invoke a request to the server after 10 minutes of the login in. Since the access token is expired, I am getting 401 error response. However, as a beginner, I find it difficult to understand

What is the purpose of a “Refresh Token”?

 ̄綄美尐妖づ 提交于 2019-11-26 22:47:38
问题 I have a program that integrates with the YouTube Live Streaming API. It runs on timers, so its been relatively easy for me to program in to fetch a new Access Token every 50 minutes with a Refresh Token. My question is, why? When I authenticated with YouTube, it gave me a Refresh Token. I then use this refresh token to get a new Access Token about once an hour. If I have the Refresh Token, I can ALWAYS use this to get a new Access Token, since it never expires. So I don't see how this is any