# None

Source: https://docs.interop.io/manager/authentication/none/index.html

## Overview

When using None authentication, the **io.Manager** Server will trust the username provided by the client in the request header and won't make any extra verifications. Based on the username, the server will determine the list of apps and Layouts to which the user has access.

**io.Connect Desktop** will always use the machine username to connect to the **io.Manager** Server. In **io.Connect Browser**, the username is provided via the platform configuration for connecting to **io.Manager** in the Main app.

> ⚠️ *Note that this authentication method isn't secure and should be used only for development purposes or in situations where security isn't a concern.*

> ℹ️ *For a complete example of using None authentication in the **io.Manager** Server and Admin UI, see the [None Authentication](https://github.com/InteropIO/manager-examples/tree/main/auth-none) example on GitHub.*

## Configuration

To enable None authentication, you must configure properly the **io.Manager** Server and Admin UI, as well as the io.Connect platform that will connect to **io.Manager** - **io.Connect Desktop** or **io.Connect Browser**.

Depending on the [deployment](https://docs.interop.io/manager/deployment/index.md) approach you have chosen, you have the following options for configuring the **io.Manager** Server and Admin UI:

- If you are using the [basic deployment scenario](https://github.com/InteropIO/manager-examples/tree/main/manager-template/1-basic) from the [template repository](https://docs.interop.io/manager/deployment/index.md#template_repository) approach, you must set properly the necessary environment variables.

- If you are using the [NPM packages](https://docs.interop.io/manager/deployment/index.md#npm_packages) for deployment, or the [advanced deployment scenario](https://github.com/InteropIO/manager-examples/tree/main/manager-template/2-advanced) from the template repository approach, you must provide the necessary configuration settings when initializing the **io.Manager** Server and Admin UI.

The following sections provide examples of both options.

### Server

To enable None authentication for the **io.Manager** Server, use the configuration object for initializing the **io.Manager** Server, or environment variables, depending on your [deployment](https://docs.interop.io/manager/deployment/index.md) approach.

#### Environment Variables

To configure the **io.Manager** Server to use None authentication, register the following environment variables with the proper values. The `API_AUTH_METHOD` environment variable must be set to `none`:

| Environment Variable | Description |
|----------------------|-------------|
| `API_AUTH_EXCLUSIVE_USERS` | List of users that will be assigned to the `GLUE42_SERVER_ADMIN` group, which grants unrestricted access to the Admin UI and to every protected endpoint of the **io.Manager** Server. The users must already exist in the database. |
| `API_AUTH_METHOD` | **Required.** Type of the authentication mechanism. Must be set to `none`. |
| `API_AUTH_NONE_ALLOW_ONLY_KNOWN_USERS` | If `true`, only the users that are already in the **io.Manager** database will be allowed to connect. If `false`, all users will be allowed to connect and new users will be automatically added to the database. Defaults to `false`. |

Example configuration:

```cmd
API_AUTH_METHOD=none
API_AUTH_EXCLUSIVE_USERS=["admin"]
API_AUTH_NONE_ALLOW_ONLY_KNOWN_USERS=true
```

> ℹ️ *For details on all available environment variables for configuring the **io.Manager** Server, see the [Configuration > Server](https://docs.interop.io/manager/configuration/server/index.md#environment_variables) section.*

#### Configuration Object

To enable None authentication for the **io.Manager** Server, set the `auth_method` property of the optional `Config` object for initializing the **io.Manager** Server to `"none"`. Use the `auth_exclusive_users` and `auth_none` properties to provide additional settings for the None authentication:

| Property | Type | Description|
|----------|------|------------|
| `auth_exclusive_users` | `string[]` | List of users that will be assigned to the `GLUE42_SERVER_ADMIN` group, which grants unrestricted access to the Admin UI and to every protected endpoint of the **io.Manager** Server. The users must already exist in the database. |
| `auth_method` | `string` | **Required.** Type of the authentication mechanism. Must be set to `"none"`. |
| `auth_none` | `object` | Settings for the None authentication mechanism. |

The `auth_none` object has the following properties:

| Property | Type | Description|
|----------|------|------------|
| `allowOnlyKnownUsers` | `boolean` | If `true`, only the users that are already in the **io.Manager** database will be allowed to connect. If `false`, all users will be allowed to connect and new users will be automatically added to the database. Defaults to `false`. |

Example configuration:

```javascript
import { start } from "@interopio/manager";

const config = {
    // Enabling None authentication.
    auth_method: "none",
    // List of users that will be assigned to the `GLUE42_SERVER_ADMIN` group.
    auth_exclusive_users: ["admin"],
    // Additional settings for None authentication.
    auth_none: {
        allowOnlyKnownUsers: true
    }
};

const server = await start(config);
```

> ℹ️ *For details on all available properties for configuring the **io.Manager** Server, see the [Configuration > Server](https://docs.interop.io/manager/configuration/server/index.md#configuration_object) section.*

### Admin UI

Every user can access the **io.Manager** [Admin UI](https://docs.interop.io/manager/overview/index.md#admin_ui); the operations available to them are determined by their [permission groups](https://docs.interop.io/manager/authorization/index.md). Users assigned to the `GLUE42_SERVER_ADMIN` group have unrestricted access. The exclusive users assigned to this group are defined in the **io.Manager** [Server configuration](#configuration-server); you can also assign it to other users from the Admin UI.

> ⚠️ *Note that when using None authentication, the Admin UI can only be opened as part of the io.Connect platforms (either defined as an io.Connect app, or opened as a URL in an io.Connect Window). If you open it directly in a standard browser, it won't be able to connect to the **io.Manager** Server and will display an error message.*

To enable None authentication for the **io.Manager** Admin UI, use the `<AdminUI />` component properties, or environment variables, depending on your [deployment](https://docs.interop.io/manager/deployment/index.md) approach.

#### Environment Variables

To configure the Admin UI to use None authentication, set the `REACT_APP_AUTH` environment variable to `none`:

```cmd
REACT_APP_AUTH=none
```

> ℹ️ *For details on all available environment variables for configuring the **io.Manager** Admin UI, see the [Configuration > Admin UI](https://docs.interop.io/manager/configuration/admin-ui/index.md#environment_variables) section.*

#### Component Properties

To enable None authentication for the Admin UI, set the `auth` property of the `<Admin UI />` component to `"none"`:

```javascript
<AdminUI
    apiURL="http://localhost:4356/api"
    auth="none"
/>
```

> ℹ️ *For details on all available component properties for configuring the **io.Manager** Admin UI, see the [Configuration > Admin UI](https://docs.interop.io/manager/configuration/admin-ui/index.md#component_properties) section.*

### io.Connect Desktop

To enable None authentication for **io.Connect Desktop**, you must configure the connection to **io.Manager** and the automatic login screen that's part of the Admin UI.

#### Connecting to io.Manager

To configure **io.Connect Desktop** to connect to **io.Manager**, use the `"server"` top-level key of the `system.json` [system configuration](https://docs.interop.io/desktop/developers/configuration/system/index.md) file of **io.Connect Desktop** located in the `<installation_location>/interop.io/io.Connect Desktop/Desktop/config` folder. Add the following basic configuration to enable connection to **io.Manager**:

```json
{
    "server": {
        "enabled": true,
        "url": "http://localhost:4356/api"
    }
}
```

This will add **io.Manager** as an additional app store and instruct it to store Layouts and app preferences. If you want **io.Manager** to be the only app store, set the `"appStores"` top-level key in the `system.json` file to an empty array.

To send client crashes to the **io.Manager** Server, edit the `"output"` property of the `"crashReporter"` top-level key in the `system.json` file:

```json
{
    "crashReporter": {
        "output": {
            "type": "server",
            "serverUrl": "http://localhost:4356/api/crashes"
        }
    }
}
```

> ℹ️ *For more configuration options for connecting to **io.Manager**, see the [Configuration > Platform](https://docs.interop.io/manager/configuration/platform/index.md#ioconnect_desktop) section.*

#### Automatic Login Screen

For None authentication to work properly in **io.Connect Desktop**, you must configure the automatic login screen that's part of the Admin UI.

To enable the login screen, use the `"ssoAuth"` top-level key of the `system.json` file. Set the `"authController"` property of the `"ssoAuth"` object to `"sso"`. Use the `"options"` object to provide the location of the login screen and settings for the io.Connect Window in which it will be loaded. The `"url"` property of the `"options"` object must point to the location of the Admin UI and must end with the `gd` query parameter, which will indicate that the login attempt is coming from **io.Connect Desktop**.

Example configuration:

```json
{
    "ssoAuth": {
        "authController": "sso",
        "options": {
            "url": "http://localhost:3000/gd",
            "window": {
                "width": 500,
                "height": 650,
                "mode": "flat"
            }
        }
    }
}
```

### io.Connect Browser

[Connecting](https://docs.interop.io/browser/capabilities/manager/index.md#setup) to **io.Manager** from an **io.Connect Browser** project requires modifying the configuration for initializing the [`@interopio/browser-platform`](https://www.npmjs.com/package/@interopio/browser-platform) library in the Main app.

To specify settings for the connection to the **io.Manager**, use the `manager` property of the optional configuration object when initializing the [`@interopio/browser-platform`](https://www.npmjs.com/package/@interopio/browser-platform) library. Unlike **io.Connect Desktop**, which uses the machine username, an **io.Connect Browser** app must provide the username explicitly through the `username` property of the `auth` object. The following example demonstrates configuring the connection to **io.Manager** with None authentication:

```javascript
import IOBrowserPlatform from "@interopio/browser-platform";

const config = {
    licenseKey: "my-license-key",
    manager: {
        // URL pointing to io.Manager.
        url: "https://my-io-manager.com:4242/api",
        // None authentication.
        auth: {
            username: "admin"
        },
        fetchIntervalMS: 10000,
        tokenRefreshIntervalMS: 15000
    }
};

const { io } = await IOBrowserPlatform(config);
```

> ℹ️ *For more configuration options for connecting to **io.Manager**, see the [Configuration > Platform](https://docs.interop.io/manager/configuration/platform/index.md#ioconnect_browser) section.*
