# Delegated Login

`POST /auth/login/delegated`

{% hint style="warning" %}
Only a [Service Account](https://docs-legacy.dfns.co/d/api-docs/authentication/service-account-management) can use this endpoint.
{% endhint %}

Logs a user into an organization without the user's credentials.

If you want to use your own authentication system, while still using `Delegated Signing`, you can use this endpoint to authenticate a user without needing the user's credentials.

The user authentication token can be used for read operations within the Dfns API, however, write operations will still require the user to sign the action.

{% hint style="info" %}

* Service account required. See [Service Accounts](https://docs-legacy.dfns.co/d/api-docs/authentication/service-account-management) for more information.
* User action signature required. See [User Action Signing](https://docs-legacy.dfns.co/d/api-docs/authentication/user-action-signing) for more information.
* Request headers required. See [Request Headers](https://docs-legacy.dfns.co/d/advanced-topics/authentication/request-headers) for more information.
* Authentication required. See [Authentication Headers](https://docs-legacy.dfns.co/d/advanced-topics/authentication/request-headers#authentication-headers) for more information.
  {% endhint %}

## Required Permissions

| Name                   | Conditions      |
| ---------------------- | --------------- |
| `Auth:Login:Delegated` | Always Required |

## Request body

|                                               |          |                                                  |
| --------------------------------------------- | -------- | ------------------------------------------------ |
| `username` <mark style="color:red;">\*</mark> | `String` | The username that identifies the user in the org |

### Example:

```json
{
  "username": "jdoe@example.co"
}
```

## Responses

{% hint style="info" %}

* See [Common Errors](https://docs-legacy.dfns.co/d/api-docs/authentication/delegated-auth/broken-reference) for common errors.
* See [Delegated Authentication Errors](https://docs-legacy.dfns.co/d/api-docs/authentication/delegated-auth/broken-reference) for delegated authentication specific errors.
  {% endhint %}

{% tabs %}
{% tab title="200" %}
**Success** - the user's authentication token

```json
{
  "token": "eyJ0eX...bzrQakA"
}
```

{% endtab %}
{% endtabs %}
