# External User Info Endpoint

Immuta can consume user attributes from an external HTTP endpoint. This feature allows you to retrieve users' groups and authorizations from an additional resource alongside the user attributes retrieved in the authentication flow. Such an external endpoint can be configured for any of the identity management protocols that Immuta supports.

## Authentication

The service can authenticate requests with both of these methods:

* Basic username and password `Authorization` header
* SSL cert validation

*Note: Immuta will expect non 200 error codes when the user info cannot be retrieved.*

## GET /user-info

The user info endpoint is called each time Immuta needs to synchronize with a remote IAM on user groups and attributes. Immuta will query the endpoint with the user ID specified in the request's query.

*Note: The endpoint's path does not have to be* `/user-info`*.*

**Query parameter**

| Name                | Description                                     | Required |
| ------------------- | ----------------------------------------------- | -------- |
| **userid** `string` | The unique user identifier (username in Immuta) | Yes      |

**Response**

| Code    | Description                                             |
| ------- | ------------------------------------------------------- |
| **200** | successful operation - user info retrieved successfully |

**Response schema**

| Attribute          | Example                                 |
| ------------------ | --------------------------------------- |
| **groups**         | `[{"name": "<group_name>"}]`            |
| **authorizations** | `{"<authorization_name>": ["<value>"]}` |

Below is a sample response that could be returned by the endpoint.

```json
{
  "groups": [{
    "name":  "Accountants",
  }, {
    "name":  "Controllers",
  }],
  "authorizations": {
    "EMEA": ["Sales", "Expenses"],
    "APAC": ["Sales"]
  }
}
```
