MobileSSO configuration with Google idp and iOS app does not accept appname://oauth/callback for a redirect URI
0
I am using Mendix 10.12.1, with modules MobileSSO 2.0.0, OIDC 2.4.0, DeepLInk 10.0.2 I am setting up a Google IDP, and integrating with an iOS deployment of my mobile app and a sandbox server. I am running into a few problems with the instructions. 1. Google IDP rejects a redirect URI that does not start with https, so I cannot enter appname://oauth/callback per the instructions in MobileSSO section 4.4.1 Configuring IdP for Mobile "Make sure to add a Custom callback URL in the client and IdP. This configuration is optional for web apps but mandatory for mobile apps. For Example, APP_NAME://oauth/callback, where APP_NAME is an application name which is used to create the application using Build Native Mobile App" 2. if I use https://appname-sandbox.mxapps.io/oauth/callback and the set the OIDC.ClientConfiguration/CustomCallbackURL to appname://oauth/callback it does not work for web or mobile sign in with google. It states the requested URL does not exist. If I set the OIDC.ClientConfiguration/CustomCallbackURL to https://appname-sandbox.mxapps.io/oauth/callback, or to /oauth/callback for both web and iOS app the login fails with this message "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again." on a browser page. Looking at MobileSSO.SUB_getMobileCallbackURL, it seems that this is expected behavior. If CustomCallbackURL is set, then it uses the callback as is or if it starts with / it prepends the app name, but if the callback is not defined, or empty, it then checks if it is a Mobile authentication, and then tries to construct the URL. Am I missing something ? The only way I can get it to partially work (for web sign in with google) is to set the OIDC.ClientConfigurat.CustomCallbackURL to https://appname-sandbox.mxapps.io/oauth/v2/callback, but then the mobile app also redirects to the web page instead of restarting the app with the new session.
asked
Nancy Nunes
1 answers
0
Hi Nancy,
I was facing the same issues. MobileSSO offers MobileSignIn and WebSignIn.
If you use ACT_StartMobileSignIn in DS_StartMobileSignIn, then your device type would be 'mobile' and you can put your mobile redirect uri under 'mobile and desktop' platform. this way you'll get callback url as 'app_name://oauth/callback'.
After getting the redirect uri and access_token as well, in last i am facing issues while saving the token and mx.session.tokenStore and log in via the authenticated user. if you have any idea about it, please let me know.