r/programminghelp • • Dec 29 '20

Java Really Odd Scenario

Im a software engineer for a company who has to implement SCA (strong customer auth) standards that are in Europe. Essentially, when you use a credit card with an online transaction, the banks could challenge that charge with a webpage that will ask a different and random type of security questions to verify the person is who they say they are. Im working in android and for some reason when a uk bank that is using Three-DS is called, it returns a 719 HTTP status code. The bank that is returning this owns 23% of uk transactions (not a small company) and its mind blowing that a company like this would return an http status code thats over 599. Anyways, Web browsers and iOS ignore this code and continues with the redirects so when hitting this bank on web or iphone, you dont see a problem. We are using a webview in the android app and the native webview has a class called WebResourceResponse and the app crashes at setStatusCodeAndReasonPhrase() public method because the http code is above 599. There is no possible way to override that class. we tried everything as a team to make this work. I don't understand how no one has raised this issue (or maybe they have but the bank hasn't changed it). We contacted the bank and are waiting on someone from the service team to talk to use but it could be months before that is changed. My question is, does anyone know of a way to ignore that status code like the browser does or third party library to capture that response code before the webview class does? we are pretty much out of options which is why im coming to reddit.

6 Upvotes

1 comment sorted by

4

u/ConstructedNewt MOD Dec 29 '20

I think you have to implement a WebResourceResponse to handle this, and use WebViewClient#shouldInterceptRequest to intercept these responses, as written in https://developer.android.com/reference/android/webkit/WebResourceResponse

I don't know how to correctly do this. But I'm not an android developer either.