App-to-web SSO
App-to-web single sign-on (SSO) allows you to take a session from your mobile application and extend it to a browser on the same device. This is useful for giving a seamless experience to your users when they transition from the mobile application to the website where more functionality likely exists. This functionality can only be used when using the OneWelcome Identity Platform identity providers. This can be configured in the IDAAS-core admin.
The React Native SDK allow you to specify a target URL where authentication is required. This URL must be configured in the action token configuration. It will then verify that your mobile application's session is valid and establish a session with the identity provider before redirecting the user to the target URL with them automatically logged in.
To use the functionality, call the startSingleSignOn
with the target URI and wait for the result. In case of success, the SingleSignOnData
data object will be returned.
Example code to use app to web sso
const exampleUrl = "https://login-mobile.test.onegini.com/personal/dashboard"
OneWelcomeSdk.startSingleSignOn(exampleUrl)
.then((it) => {
// open external browser
Linking.openURL(it.url)
})
.catch(erro) => {
Alert.alert('Error', error.message)
}