# 匿名登入
---
## Dashboard開啟匿名登入功能
1. 需要有Root Tenant Admin權限
- 這種user在Dashboard那邊會具有System Admin權限, 能看到Server admin選單

2. 進入Dashboard Server Admin -> Settings

3. 找到auth.anonymous選項, 點選編輯

4. 編輯`enabled`, 選擇true

5. 編輯`org_name`, 選擇你想要做匿名登入的org, 權限選Viewer, 按下Add新增

6. 完成步驟5後, 按下Settings分頁的綠色更新按鈕, 完成本次變更

## Datasource配置
1. 進入你要配置的組織的Data Sources setting

2. 找到deviceon-bi-simplejson, 點進去

3. 需要額外新增的設定如下:
- Assign SSO Url:開啟
- SSO URL:輸入SSO API URL, 以Edge365 master站為例, URL為
- https://api-sso-ensaas.edge365.advantech.com
- Skip TLS Verify:開啟
- Anonymous:開啟
- Anonymous.user:輸入這個環境中的一個帳號, 會以這個帳號當作匿名登入的登入者
- Anonymous.password:輸入帳號的密碼

4. 按下`Save & Test`, 出現設定成功的訊息

## 從Command Center建立一個匿名登入的SRPFrame
1. 新增可以給public看的dashboard

2. 在新增/編輯Dashboard時, 將這一張Dashboard 的 Visibility設定成General即可

3. 進入Menu List功能, 新增or編輯一個Menu, 將Availability設定為Public

4. 編輯Menu中的Dashboard, 請選擇步驟2中,Visibility設定成General的Dashboard
這邊會發現, 這類型的Dashboard會被放置於Dashboard/General資料夾下

5. 設定完畢後,複製這個Menu的URL

6. 以訪客權限開啟一個新的browser

7. 貼上Menu URL, 確認不需登入的狀態下, 能看到Dashboard內容

## 手動新增Dashboard權限, 讓Visibility = Private的Dashboard也能匿名使用
Edge365因為安全性的考量, 目前有將Group的User權限新增到Folder權限中
- group user = Dashboard folder user
- 移除Dashboard folder user中的 "Viewer"權限, 否則這個org下的其他user都能看到這個Folder中的Dashboard內容

- 如果認為Folder中的Dashboard都是要做匿名登入可公開的內容, 可以直接加上Viewer權限到該Folder上
1. Dashboards選單 -> Manage

2. 找你要編輯的folder, 點選設定

3. 切換到Permission分頁,點選Add permission

4. 選`Everyone With Viewer Role` 與 `View`, 按下Save保存設定

5. 可以看到folder人員列表中多了一個Viewer

6. 去Menu設定中, 設定一張Dashboard是放置在你這個Group中的

7. 開啟訪客瀏覽器, 確認這張Dashboard也能正常顯示

---
# Anonymous Login
---
## Enabling Anonymous Login in the Dashboard
1. You need to have Root Tenant Admin permissions.
- Users with Root Tenant Admin permissions in the Dashboard have System Admin privileges and can access the Server Admin menu.

2. Go to Dashboard Server Admin -> Settings.

3. Find the `auth.anonymous` option and click on `Edit`

4. Edit the `enabled` option and select "true"

5. Edit the `org_name` option and select the organization for which you want to enable anonymous login. Choose the "Viewer" role and click `Add` to add it.

6. After completing Step 5, click the green update button on the Settings page to apply the changes.

## Configuring the Datasource
1. Go to the Data Sources settings of the organization you want to configure.

2. Find `deviceon-bi-simplejson` and click on it.

3. The following additional settings need to be added:
- Assign SSO URL: Enable
- SSO URL: Enter the SSO API URL, for example, for Edge365 master site:
- https://api-sso-ensaas.edge365.advantech.com
- Skip TLS Verify: Enable
- Anonymous: Enable
- Anonymous.user: Enter a username from your environment to be used for anonymous login.
- Anonymous.password: Enter the password for the above user.

4. Click `Save & Test` to confirm the successful configuration.

## Creating an Anonymous Login SRPFrame from Command Center
1. Create a dashboard that can be viewed by the public.

2. When adding/editing the dashboard, set its Visibility to "General".

3. Access the Menu List feature and add/edit a menu. Set the Availability to "Public".

4. Edit the Dashboard within the menu and select the dashboard with General Visibility (as set in Step 2). This type of dashboard will be placed in the Dashboard/General folder.

5. After configuring, copy the URL of this menu.

6. Open a new browser in guest mode.

7. Paste the Menu URL and verify that the dashboard content is visible without the need for login.

## Manually Adding Dashboard Permissions for Anonymous Usage of Private Dashboards
For security reasons, Edge365 has added Group User permissions to Dashboard Folder permissions. This means that:
- Group User = Dashboard Folder User
- "Viewer" permissions are removed from Dashboard Folder permission, other users within the organization will not be able to see the contents of that folder.

If you want to allow anonymous access to all Dashboards within a specific folder, you can directly add "Viewer" permissions to that folder:
1. Go to the Dashboards menu and select `Manage`

2. Find the folder you want to edit and click on `Settings`

3. Switch to the Permissions tab and click `Add permission`

4. Select `Everyone With Viewer Role` and choose `View`. Then click `Save` to save the settings.

5. You will see that a new `Viewer` is added to the list of people in the folder.

6. In the Menu settings, select a Dashboard that is placed within your Group.

7. Open a guest browser and verify that the Dashboard is displayed correctly.

---
###### tags: `Edge365`