Rocket.Chat
Rocket.Chat copied to clipboard
Custom Login
how to login without using login form?
You need to use one of the following:
- CAS
- SAML
- OAuth
- LDAP
- IFrame Login
you have any example of iFrame login.
We are still writing the documentation, but id does something like:
The Flow for Facebook on Cordova:
- We call your API to se if the user is logged in, if yes, we close the iframe, if no continue
- We redirect the iframe to your login screen
- The user will click on facebook button
- You will call our method call-facebook-login
- We will open the facebook application to login
- 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})
- You will proceed the login flow as you are doing today
- 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
- 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:
- We call your API to se if the user is logged in, if yes, we close the iframe, if no continue
- We redirect the iframe to your login screen
- You will proceed the login flow as you are doing today
- 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
- 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
Is there a way for me to enable iframe login but also allow users to login in using the form?