You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My app practices incremental permissions, so first we ask you for X, and then if we need Y later we ask you for Y later.
But, if you deny us Y, the gapi client loses the token for X.
We could save the previous token and manually restore it on auth failure, but then of course we get race conditions. I'd like an easy way to aggregate permissions in the client token, so I could call
and be relatively confident that at the end I'll end up with a token that represents the available permissions (for example, maybe I end up with X and Z).
I could write a wrapper to authorize that does some traffic control, makes sure only one authorize request is in flight at a time, manages the conflict resolution (while staying timeout-aware), etc etc etc.. but it seems like it might be within the scope of gapi.auth.authorize to handle all of this for me.
Let me know if there's a better place to post an issue like this. Thanks for any advice!
The text was updated successfully, but these errors were encountered:
To clarify a bit, I do know about include_granted_scopes and that behavior is working great. But the problem I'm facing is that if the user has NOT granted the scope for Y in my example, and the authorization attempt fails, then I lose my token altogether! Because Y returns a rejection, the client forgets all about the fact that it actually has access to X and Z.
My app practices incremental permissions, so first we ask you for X, and then if we need Y later we ask you for Y later.
But, if you deny us Y, the gapi client loses the token for X.
We could save the previous token and manually restore it on auth failure, but then of course we get race conditions. I'd like an easy way to aggregate permissions in the client token, so I could call
and be relatively confident that at the end I'll end up with a token that represents the available permissions (for example, maybe I end up with X and Z).
I could write a wrapper to authorize that does some traffic control, makes sure only one
authorize
request is in flight at a time, manages the conflict resolution (while staying timeout-aware), etc etc etc.. but it seems like it might be within the scope of gapi.auth.authorize to handle all of this for me.Let me know if there's a better place to post an issue like this. Thanks for any advice!
The text was updated successfully, but these errors were encountered: