# SSO Login URL: https://developers.vsee.com/guides/clinickit/sso-login This flow logs a user in with a Single Sign-On (SSO) token provided by VSee, using the `loginBySSOToken` function from the VSeeClinicCore framework (iOS). On Android, see [SSO authentication](https://developers.vsee.com/guides/clinickit/android-enter-waiting-room#1-3-sso-authentication) in the Android Enter Waiting Room Flow. ### Preconditions - VSee provides the SSO token. It is required for login. ### Use case steps 1. **Initiate login with the SSO token:** the app starts the login by calling `loginBySSOToken` with the SSO token from VSee. ```swift public func loginBySSOToken(_ token: String, success: @escaping() -> Void, failure: @escaping (Error) -> Void) { // Perform the login process with the provided SSO token. } ``` ![Log in by SSO token](https://developers.vsee.com/images/guides/clinickit/sso-login/sso-token.png) 2. **User authentication:** VSeeClinicCore uses the SSO token to authenticate the user with VSee's servers. 3. **Login success:** if authentication succeeds, the `success` closure passed to `loginBySSOToken` runs, and the user is logged in. ![Login success](https://developers.vsee.com/images/guides/clinickit/sso-login/login-success.png) 4. **Login failure:** if authentication fails because the SSO token is invalid or expired, or for any other reason, the `failure` closure runs with an `Error` object, so the app can handle the failure gracefully. ![Login failure](https://developers.vsee.com/images/guides/clinickit/sso-login/login-failure.png) ### Error handling When login fails, inspect the `Error` object passed to the `failure` closure. It describes why login failed, so the app can show a suitable error message or recover. ### Conclusion Logging in with an SSO token through VSeeClinicCore lets your app integrate with VSee and give users a smooth login. The SSO token must come from VSee. Follow the steps above and handle errors, and users get a secure login through VSee's authentication. ### Try the API calls interactively The [Member SSO](https://developers.vsee.com/use-cases/mobile-sso) use case walks through the same flow with live API calls.