apache / apache/cordova-plugin-inappbrowser

Redirect not working on IOS

Open
#484 8 comments 0 reactions 0 assignees View on GitHub
platform: ios
Dominant language
Java
Stars
1.1k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

Hello,

We have built an app that logs in via OpenId Connect. The login on our
Cordova app functions well on Android devices but fails when we log in on an
IOS device. This seems to be because the redirects that happen between the
inAppBrowser and the ADFS server function differently on IOS than they do on
an Android device.

The sequence of requests are something linke this on both Android and IOS:

POST credentials --> ADFS Server
GET uriWithRedirct header --> ADFS Server
GET redirectURI --> APP Backend

(In the chrome Network tab the POST is shown as cancelled and the next line is
a GET to the same URI where the response contains a "Location: ..." header)

On IOS this results in a blank page with the title "HTTP 1.1 Service
Unavailable" which I think is generated by IOS or in the inAppBrowser
somewhere as I am quite sure that our APP backend does not generate a page
with this content.

With this page showing it is now possible to log in by pressing the back
button on the IOS device. This results in a correct login to the app backend
to which we have been redirected, but of course we are not interested in
having to manually press the back button to log in :)

On Android the login happens correctly without this page showing and I suspect
that there is something going wrong with the redirects, but I am not sure how
to solve this.

Has anyone run into the same or a issue?

Notes:

* we are not using the wkwebview.
* we build our cordova abb using the phonegap build service

## Checklist

- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

The report identifies the iOS inAppBrowser redirect flow, the ADFS server, the app backend, and the non-WKWebView setup, but names no repository files or tests. Start by reproducing the POST/redirect sequence on iOS and Android, then trace where the blank Service Unavailable page appears. Done means login reaches the app backend on iOS without requiring the back button.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios
Domain
authentication, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.