Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Custom Login

Open sudhirkumargpt opened this issue 10 years ago • 4 comments

how to login without using login form?

sudhirkumargpt avatar Apr 05 '16 09:04 sudhirkumargpt

You need to use one of the following:

  • CAS
  • SAML
  • OAuth
  • LDAP
  • IFrame Login

engelgabriel avatar Apr 05 '16 21:04 engelgabriel

you have any example of iFrame login.

sudhirkumargpt avatar Apr 06 '16 09:04 sudhirkumargpt

We are still writing the documentation, but id does something like:

The Flow for Facebook on Cordova:

  1. We call your API to se if the user is logged in, if yes, we close the iframe, if no continue
  2. We redirect the iframe to your login screen
  3. The user will click on facebook button
  4. You will call our method call-facebook-login
  5. We will open the facebook application to login
  6. After the response from the facebook native login we will post a message postMessage({event: 'facebook-login-success’, response: response}) or postMessage({event: 'facebook-login-error’, error: error, response: response})
  7. You will proceed the login flow as you are doing today
  8. If you have that token you return in your API you can call window.postMessage({event: 'login-with-token', token: '123123...'}, '*’) , we will authenticate and close the iframe
  9. If not, you should call window.postMessage({event: 'try-iframe-login'}, '*’) and we will call your API to get the token and do the auth, and then close the iframe

The Flow for other methods:

  1. We call your API to se if the user is logged in, if yes, we close the iframe, if no continue
  2. We redirect the iframe to your login screen
  3. You will proceed the login flow as you are doing today
  4. If you have that token you return in your API you can call window.postMessage({event: 'login-with-token', token: '123123...'}, '*’) , we will authenticate and close the iframe
  5. If not, you should call window.postMessage({event: 'try-iframe-login'}, '*’) and we will call your API to get the token and do the auth, and then close the iframe

engelgabriel avatar Apr 06 '16 11:04 engelgabriel

Is there a way for me to enable iframe login but also allow users to login in using the form?

akachapati avatar Nov 10 '16 09:11 akachapati