Hi Yan,
We have built something like this before,
And the answer is: yes you can! When user login to webapp using CAS protocol, they can SSO to their native app.
However some implementation is needed, I can give you some information on this:
- So achieve this, you would want the native app to not use WebView to open browser, instead us Chrome Custom Tab for Android / Safari View Controller for iOS
- it is quite complicated to setup the Chrome custom tab or Safari View Controller yourself, so I recommend using the AppAuth library (supported by Google) instead:
- AppAuth iOS:
https://github.com/openid/AppAuth-iOS- The behavior is like the below:
- When user login to your app, it will pop up a in-app browser inside the app (instead of redirecting to the outside browser / instead of using webview)
- Since user already login, CAS will redirect to the redirect_uri, so this screen will flash for a sec
- The in-app browser then will be closed, and AppAuth library will handle the rest of the login.
In the case where user it not login yet, CAS login screen will be shown, and the flow will be the same after user authenticate successfully
See if the above helps you.
Cheers!
- Andy