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
I am working on an app where we use an external authentication system based on JWT/Bearer access tokens. The solution is based on the feature added with this PR (parse-community/parse-server#6411) on server side. Now, we want to add our Bearer token to Parse query requests as described here: parse-community/docs#819.
However, apps typically renew such a bearer token quite often by using a refresh token flow etc. So we need to update the bearer token often. One solution for example would be to acquire a fresh Bearer token before every request (if needed) and then use the latest token on the request.
Feature / Enhancement Description
Pass one or many interceptor functions to Parse which are executed (in order) when a query is made. These interceptors can run asynchronous code.
Example Use Case
Append (dynamic) headers to network requests.
Alternatives / Workarounds
It is currently possible to pass custom headers via Parse.CoreManager to network requests, however these are static.
I found this issue asking for failure interceptors which are kind of similar: #19
However, the answer is quite presumptuous in my opinion. There are valid use cases for global interceptors and per request interceptors. Would be nice if the SDK provides mechanisms for both ways.
New Feature / Enhancement Checklist
Current Limitation
I am working on an app where we use an external authentication system based on JWT/Bearer access tokens. The solution is based on the feature added with this PR (parse-community/parse-server#6411) on server side. Now, we want to add our Bearer token to Parse query requests as described here: parse-community/docs#819.
However, apps typically renew such a bearer token quite often by using a refresh token flow etc. So we need to update the bearer token often. One solution for example would be to acquire a fresh Bearer token before every request (if needed) and then use the latest token on the request.
Feature / Enhancement Description
Pass one or many interceptor functions to Parse which are executed (in order) when a query is made. These interceptors can run asynchronous code.
Example Use Case
Append (dynamic) headers to network requests.
Alternatives / Workarounds
It is currently possible to pass custom headers via
Parse.CoreManager
to network requests, however these are static.I found this issue asking for failure interceptors which are kind of similar: #19
However, the answer is quite presumptuous in my opinion. There are valid use cases for global interceptors and per request interceptors. Would be nice if the SDK provides mechanisms for both ways.
3rd Party References
Axios provides interceptors: https://axios-http.com/docs/interceptors
For native apps this is also often possible via the networking library, e.g. OkHttp for Android: https://square.github.io/okhttp/features/interceptors/
The text was updated successfully, but these errors were encountered: