Rocket.Chat.ReactNative icon indicating copy to clipboard operation
Rocket.Chat.ReactNative copied to clipboard

userAgent Inquiry

Open AgentTNT opened this issue 6 years ago • 4 comments

Can anyone please tell me why we have these hard coded values in the following file?

app/views/AuthenticationWebView.js

const userAgent = isIOS
	? 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1'
	: 'Mozilla/5.0 (Linux; Android 6.0.1; SM-G920V Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36';

If the Rocket.Chat server has Google oAuth configured, and after a successful sign in via Android, users are sent a security email from Google regarding a new login from a Samsung Galaxy S6 device (SM-G920V mentioned in the string above).

As expected, users assume there is rogue activity on their account and begin the process of resetting passwords and such for their Google account.

Can we use this issue to discuss a better solution for this and bring awareness?

AgentTNT avatar Mar 01 '20 07:03 AgentTNT

I don't know why this user agents have been chosen, and if there's some requirement here. Maybe a form like in /app/utils/fetch.js could be used.

phriedrich avatar Mar 01 '20 11:03 phriedrich

@diegolmello / @djorkaeffalexandre,

Can we get some visibility into this? My users are still experiencing this. I personally deem this to be bad practice of forcing the entirety of the string when other such options exist to make it more dynamic. Do we know what initially broke that forced these values?

For web tracking/log parsing of the connected agent, it's also throwing off those values to determine what compatibility issues there may be for TLS and cipher types when determining the user base that may be impacted if newer standards are implemented.

AgentTNT avatar Apr 16 '20 15:04 AgentTNT

@AgentTNT We enforce user agent to mimic a browser only because Google disallow sign in via Webview.

We don't have enough hands to work on this right now, but if you really need it, you can make it work using this lib: https://github.com/react-native-community/google-signin I would be glad to review your PR. Thanks.

diegolmello avatar Apr 16 '20 16:04 diegolmello

Fixed by making Google auth use external browsers

diegolmello avatar Jan 20 '23 14:01 diegolmello