FormidableLabs / FormidableLabs/react-native-app-auth
Add Custom User-Agent into Authorize Page
- Dominant language
- Java
- Stars
- 2.3k
- Forks
- 473
- PR merge metrics
- No merged PRs in 30d
Description
I apologize before-hand if this is something that already exists, but I could not make this work, even when searching for this in the documentation.
We're trying to add a custom `User-Agent` header into the browser that opens the authorisation prompt. For this we tried to use both `customHeaders` and `additionalHeaders` for both iOS and Android, but we haven't been able to update the `User Agent`.
We've tried several combinations, like:
This resulted in a crash for iOS, with a 400 Bad Request being thrown.
```
additionalHeaders: {
'User Agent':
'Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1 Test'
}
```
The following two had no impact whatsoever.
```
additionalHeaders: {
'User-Agent':
'Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1 Test'
}
```
```
additionalHeaders: {
'UserAgent':
'Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1 Test'
}
```
Is there any possibility for this feature to be implemented, or is it already present / can be done through a workaround?
Thank you for the support!
Contributor guide
Assessment
This issue has not been assessed yet.