Unverified Commit f7fc7713 authored by Rogerio Saboia's avatar Rogerio Saboia Committed by gitbook-bot
Browse files

GitBook: [master] 6 pages and 2 assets modified

parent 6fc66a88
......@@ -201,7 +201,8 @@
* [Deprecation](guides/developer/deprecation.md)
* [Embedded Layout](guides/developer/embedded-layout.md)
* [Iframe Integration](guides/developer/iframe-integration/README.md)
* [What is iframe auth?](guides/developer/iframe-integration/authentication.md)
* [What is iframe auth?](guides/developer/iframe-integration/authentication/README.md)
* [Testing the iFrame Authentication](guides/developer/iframe-integration/authentication/testing-the-iframe-authentication.md)
* [Iframe Events](guides/developer/iframe-integration/events.md)
* [Iframe integration: Sending commands](guides/developer/iframe-integration/commands.md)
* [Two Factor Authentication](guides/developer/two-factor.md)
......
......@@ -28,14 +28,14 @@ Even using Rocket.Chat inside an iframe you can still use this method to make th
This flow requires a page to be rendered in place of the normal Rocket.Chat's login page, it can be a basic loading screen since it's used just for information purposes.
The other setting you configure here is the [API URL and Method ](../../developer/iframe-integration/authentication.md#api-url-and-api-method)to be called once a not authenticated user opens the Rocket.Chat. Then Rocket.Chat will make an HTTP call to you endpoint expecting a [JSON response containing the authToken](../../developer/iframe-integration/authentication.md#using-rocket-chat-api), so you should use cookies to identify if the user calling your own API is authenticated and make the process to generate the Rocket.Chat's token and return it:
The other setting you configure here is the [API URL and Method ](../../developer/iframe-integration/authentication/#api-url-and-api-method)to be called once a not authenticated user opens the Rocket.Chat. Then Rocket.Chat will make an HTTP call to you endpoint expecting a [JSON response containing the authToken](../../developer/iframe-integration/authentication/#using-rocket-chat-api), so you should use cookies to identify if the user calling your own API is authenticated and make the process to generate the Rocket.Chat's token and return it:
1. Rocket.Chat will call the configured API and Method to retrieve the token
2. The API should validate your own session via cookies
3. The API will then call the Rocket.Chat APIs to check if the user exists
1. If it doesn't exists call the Rocket.Chat APIs to create the user
4. If the user exists, call the Rocket.Chat APIs to make the login and receive the token
5. Return the token in your API response in JSON format as [described here](../../developer/iframe-integration/authentication.md#using-rocket-chat-api)
5. Return the token in your API response in JSON format as [described here](../../developer/iframe-integration/authentication/#using-rocket-chat-api)
6. Rocket.Chat will use the token automatically to make the authentication
{% hint style="warning" %}
......
......@@ -4,7 +4,7 @@
If you want to authenticate users using your own login page in place of the Rocket.Chat's login page via the iframe integration, go to `Administration > Accounts > Iframe` and enable it:
* [How to use iframe integration for authentication](authentication.md)
* [How to use iframe integration for authentication](authentication/)
## Use Rocket.Chat in your site/app inside an iframe
......
# Testing the iFrame Authentication
This article will describe how to test the iFrame authentication, using a test tool developed by Rocket.Chat team. This test scenario is based in a localhost environment.
## Step 1
Download and start the _iframe-auth-example_ test service following the steps mentioned [here](https://github.com/RocketChat/iframe-auth-example)
The test service code can be used as an example on how to setup the iFrame auth calls to Rocket.Chat. Code is available [here](https://github.com/RocketChat/iframe-auth-example/blob/master/index.js).
## Step 2
Configure Rocket.Chat server \(_Administration > Accounts > iFrame_\) as follows:
![](../../../../.gitbook/assets/84309416-78b60580-ab36-11ea-9777-f2c0138a9677.png)
## Step 3
Test the iFrame service by calling Rocket.Chat login URL \(in this example, _http://localhost:3000\)_
![](../../../../.gitbook/assets/2020-08-12_10-58.png)
In this moment, the _iframe-auth-example_ service runs and the iframe authentication calls are executed.
By default, the test service code expects the login to be done with the following credentials \(harcoded\)
`username: new-user`
`password: new-users-passw0rd`
Change the `currentUsername` \(line 105\) to `true` so you can login again with the same user. By changing the code you may use any user which already exists in Rocket.Chat
Further reference can be found [here](https://github.com/RocketChat/Rocket.Chat.ReactNative/pull/2184).
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment