refreshHeaders property
Optional refreshHeaders applied on requests to refreshUrl
Defaults to: {"Authorization": "Bearer {accessToken}"}
The template variable {accessToken}
will automatically be replaced with your app's current auth token.
If you do not want any headers applied on requests to {refreshUrl}, provide an empty {}
.
Example
BackgroundGeolocation.ready(Config(
authorization: Authorization(
strategy: "JWT",
accessToken: "XXX.YYY.ZZZ",
refreshUrl: "https://auth.domain.com/tokens",
refreshToken: "smTsfaspfgaadsfgqZerUt0wueflasdfkaxjdfeKIacb",
refreshPayload: {
"my_refresh_token": "{refreshToken}", // <-- replaced with configured refreshToken above.
"grant_type": "refresh_token", // <-- arbitrary fields required by your auth server
"foo": "another arbitrary field"
},
refreshHeaders: {} // <-- Empty {} to provide no refreshHeaders.
)
));
Implementation
Map? refreshHeaders;