Custom-URL-scheme icon indicating copy to clipboard operation
Custom-URL-scheme copied to clipboard

BankID difficulties

Open petercutting opened this issue 6 years ago • 6 comments
trafficstars

.1) My App needs to start BankID .X) user enters passphrase into BankID app .2) BankID needs to start my App

Things seem to be working on Android. On iOS BankID launches but I cannot get it to redirect back to my App ie 2). I guess Android works because 2) is just a Back operation. On iOS it is more complex.

This plugin advertises itself as "launch your app by a link like this: mycoolapp://" . which is 2) above. The funny thing is my app can also do 1) (ie start another app) as long as I have the following BankID URL_SCHEME parameter in config.xml

<plugin name="cordova-plugin-customurlscheme" spec="4.4.0" source="npm">
    <param name="URL_SCHEME" value="bankid" />
</plugin>

So I seem to be using the plugin in the wrong drirection.

The BankID documentation sais I must :- "register a Universal Link or a custom URL scheme to make it possible for the BankID app to re-launch (my) app". Universal Link looks very complex so I hope I can avoid it.

I would expect that I would name myapp (where bankid is) above. so that BankID can launch it using the redirect that I provide

window.open('bankid://?redirect=', '_system')

To sum up, on iOS, I seem to be able to use this plugin to start another app (going against the spec), and I cannot seem to use it to do what it is specieifed to do, ie make my app startable

confused

petercutting avatar Jun 24 '19 13:06 petercutting

I seem to have fixed it. I was starting bankid the wrong way. I was using bankid:// but now use https://app.bankid.com/

this means that I can change

to

so now I can configure bankid to redirect back to myapp://

This works but unfortunately I have a new error which is that the redirect seems to start myapp instead of resuming it

petercutting avatar Jun 26 '19 07:06 petercutting

Would you mind telling some more about how to start BankID from a Cordova app? My email is [email protected]

frebe73 avatar Sep 23 '19 19:09 frebe73

I seem to have the same issue. I'm even using the correct URL to start bankId https://app.bankid.com/. But the redirect link doesn't go back to my ios flutter app. Custom URL is working fine as well. Can u help me give some pointers what could be the issue.

ShizaS avatar Jan 13 '21 10:01 ShizaS

getting the bankid app to redirect back to my app was tricky but it works.

It seems that the scheme can only be set once (using Cordova). I have multiple schemes for dev, test , prod so when building a different scheme I must start from scratch

So I must recreate the iOS platform, which is unfortunate (XCode), but required in order to recreate the customurlscheme plugin with the desired scheme

cordova platform rm ios
cordova platform add [email protected]
cordova plugin rm cordova-plugin-customurlscheme
cordova plugin add cordova-plugin-customurlscheme --variable URL_SCHEME=${appBundleid}

petercutting avatar Jan 13 '21 10:01 petercutting

it seems the customUrl schemes in ios are working fine but there's some issue with redirection from bankID. What do u think?

ShizaS avatar Jan 13 '21 11:01 ShizaS

well it is my understanding that customurlscheme is used to define the scheme of the app so that the bankid app has something to redirect back to

petercutting avatar Jan 13 '21 11:01 petercutting