# Automatic login does not work when using ZoomSDKAuthService' loginSSO with rememberMe set to YES

**URL:** <https://devforum.zoom.us/t/automatic-login-does-not-work-when-using-zoomsdkauthservice-loginsso-with-rememberme-set-to-yes/19949>\
**Category:** macOS\
**Created:** [June 2, 2020, 10:50am UTC](https://devforum.zoom.us/t/automatic-login-does-not-work-when-using-zoomsdkauthservice-loginsso-with-rememberme-set-to-yes/19949 "2020-06-02T10:50:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter.kutasi](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/peter.kutasi/32/6365_2.png) [@peter.kutasi](https://devforum.zoom.us/u/peter.kutasi)\
**Post date:** [June 2, 2020, 10:50am UTC](https://devforum.zoom.us/t/automatic-login-does-not-work-when-using-zoomsdkauthservice-loginsso-with-rememberme-set-to-yes/19949/1 "2020-06-02T10:50:01Z")

</div>

**Description**

Automatic login does not work on consecutive application sessions and Zoom SDK initialization after using ZoomSDKAuthService API `- (ZoomSDKError)loginSSO:(NSString*)ssoToken RememberMe:(BOOL)rememberMe` with valid SSO token (we can login successfully) and `rememberMe` flag set to `YES`.

**Which version?**  
v4.6.21666.0427

> **[zoom/zoom-sdk-macos](https://github.com/zoom/zoom-sdk-macos/releases/tag/v4.6.21666.0427)**
>
> Zoom macOS SDK. Contribute to zoom/zoom-sdk-macos development by creating an account on GitHub.

**To Reproduce(If applicable)**

1. During user SSO authentication we request OAuth access token as described here:

> **[OAuth 2.0 - Authorization - Documentation](https://marketplace.zoom.us/docs/guides/auth/oauth)**
>
> OAuth with Zoom
> 
> The Zoom API uses OAuth 2.0 to authenticate and authorize users to make requests. To setup access credentials and request scopes for yo...

1. Then with the access token we request a user token with this API

> **[Get a User Token - Users - Zoom API - API Reference](https://marketplace.zoom.us/docs/api-reference/zoom-api/users/usertoken)**
>
> Retrieve a user's token. This token is used for starting meetings with the Client SDK.
> Scopes: user:read:admin user:read
> 
> Rate Limit Label: Light
> If a ...

1. We pass the user token to `- (ZoomSDKError)loginSSO:(NSString*)ssoToken RememberMe:(BOOL)rememberMe` as described above with `rememberMe` parameter set to `YES`.

2. User login is successful

3. After restarting our application `- (void)onZoomSDKLogin:(ZoomSDKLoginStatus)loginStatus failReason:(NSString*)reason;` delegate gets called with loginStatus `ZoomSDKLoginStatus_Failed` and reason `nil`.

Expected behaviour:

`- (void)onZoomSDKLogin:(ZoomSDKLoginStatus)loginStatus failReason:(NSString*)reason` delegate should be called with `ZoomSDKLoginStatus_Success`. Previously logged in user authenticated automatically by the SDK.

**Additional context**

Might be worth to mention that `rememberMe` set to `YES` works when we use `- (ZoomSDKError)login:(NSString*)userName Password:(NSString*)password RememberMe:(BOOL)rememberMe`. On consecutive application starts user gets logged in automatically.

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [June 3, 2020, 10:06am UTC](https://devforum.zoom.us/t/automatic-login-does-not-work-when-using-zoomsdkauthservice-loginsso-with-rememberme-set-to-yes/19949/2 "2020-06-03T10:06:30Z")

</div>

Hi @peter.kutasi,

Thanks for the post. It seems like the reason why it is not working is that the SSO login was not a success. Please refer to my answer here: [Can't login with user token acquired after OAuth with email / password using ZoomSDKAuthService loginSSO method](https://devforum.zoom.us/t/cant-login-with-user-token-acquired-after-oauth-with-email-password-using-zoomsdkauthservice-loginsso-method/19958)

Hope this helps. Thanks!

---

<div class="post-metadata">

**Author:** ![peter.kutasi](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/peter.kutasi/32/6365_2.png) [@peter.kutasi](https://devforum.zoom.us/u/peter.kutasi)\
**Post date:** [June 24, 2020, 6:11am UTC](https://devforum.zoom.us/t/automatic-login-does-not-work-when-using-zoomsdkauthservice-loginsso-with-rememberme-set-to-yes/19949/3 "2020-06-24T06:11:18Z")

</div>

Hi @carson.zoom

Thanks for the reply! You are right, we misused the SSO login API, mixed the OAuth and SSO login. The strange thing was that the login was successful with the token we got from the usertoken endpoint after an OAuth authentication, but I see now that this is not the intended usage. At the end we switched to use ZAK token to start meeting in case the user was authenticated with OAuth.

Thanks again!  
Peter

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [June 26, 2020, 11:33pm UTC](https://devforum.zoom.us/t/automatic-login-does-not-work-when-using-zoomsdkauthservice-loginsso-with-rememberme-set-to-yes/19949/4 "2020-06-26T23:33:45Z")

</div>

Hi @peter.kutasi,

Thanks for the update and glad to hear that it is working for you now. Happy Zooming!

Thanks!

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 10:28pm UTC](https://devforum.zoom.us/t/automatic-login-does-not-work-when-using-zoomsdkauthservice-loginsso-with-rememberme-set-to-yes/19949/5 "2020-08-21T22:28:54Z")

</div>

Closed on August 21, 2020, 10:28pm UTC


