Skip to content

[NEW] IFrame authentication#2184

Merged
diegolmello merged 9 commits intodevelopfrom
new.iframe-auth
Jun 17, 2020
Merged

[NEW] IFrame authentication#2184
diegolmello merged 9 commits intodevelopfrom
new.iframe-auth

Conversation

@djorkaeffalexandre
Copy link
Copy Markdown
Contributor

@djorkaeffalexandre djorkaeffalexandre commented Jun 10, 2020

@RocketChat/ReactNative

Closes #688.

Test plan

Configuring iframe authentication at server level:

  1. Start iframe-auth-example
    https://github.com/RocketChat/iframe-auth-example
  2. Your Server > Administration > Accounts > iFrame
    Screen Shot 2020-06-10 at 16 20 11
  3. Make login once by the web client or mobile client using these credentials:
    username: new-user
    password: new-users-passw0rd
  4. Change the currentUsername (line 105) to true so you can login again with the same user.

Troubleshooting
If your Android emulator can't connect to localhost as mine, you'll need to change the server configuration to your machine ip (http://10.0.2.2:3000) and change the code of iframe-auth-example at the line 151 from localhost to your machine ip.

References:
https://docs.rocket.chat/guides/developer-guides/iframe-integration/authentication#iframe-url
https://github.com/RocketChat/Rocket.Chat/blob/develop/app/ui-utils/client/lib/IframeLogin.js
https://github.com/RocketChat/Rocket.Chat/blob/develop/app/iframe-login/client/iframe_client.js

@djorkaeffalexandre djorkaeffalexandre marked this pull request as ready for review June 10, 2020 20:48
@djorkaeffalexandre djorkaeffalexandre changed the title [WIP] IFrame authentication [NEW] IFrame authentication Jun 10, 2020
@diegolmello diegolmello merged commit a992c51 into develop Jun 17, 2020
@diegolmello diegolmello deleted the new.iframe-auth branch June 17, 2020 20:12
@pbenkoe
Copy link
Copy Markdown

pbenkoe commented Jun 19, 2020

This looks great, thank you!
So if one has a working instance with iFrame authentication set up, is there anything else that needs to be done to make it work for the mobile clients once this update is released?
I don't quite know what's meant with steps 3. and 4. in the description above.
Thank you!

@djorkaeffalexandre
Copy link
Copy Markdown
Contributor Author

djorkaeffalexandre commented Jun 19, 2020

Hey @pbenkoe, it'll work at mobile side without any extra step. 😁
These steps described here are just to test the implementation. :)