# IRPCExtensionAuthentications.StoreExtensionAuthenticationCredentials

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md) > [Extension authentications](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCExtensionAuthentications/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCExtensionAuthentications/StoreExtensionAuthenticationCredentials/

Badges: `Vault API / standard` `write` `session` `returns metadata structure version`

Logs the caller in to an external system by storing the caller's credentials for it.

- **Service:** [Extension authentications](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCExtensionAuthentications/index.md) `MFiles.IRPCExtensionAuthentications`
- **gRPC method:** `/MFiles.IRPCExtensionAuthentications/StoreExtensionAuthenticationCredentials`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/store-extension-authentication-credentials`
- **Request:** [`StoreExtensionAuthenticationCredentialsRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCExtensionAuthentications/StoreExtensionAuthenticationCredentials/index.md#request)
- **Response:** [`StoreExtensionAuthenticationCredentialsResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCExtensionAuthentications/StoreExtensionAuthenticationCredentials/index.md#response)
- **Book and level:** Vault API, standard
- **Kind:** write
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** no
- **Returns metadata structure version:** yes (in the mfiles-metadata-version-bin trailer)
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- Requires a vault session of a user; anonymous sessions fail. `target` must not be empty
  ("The parameter is incorrect. (Invalid target name.)").
- Replaces credentials already stored for the caller and the target.
- The credentials travel in clear text inside the message. Use this method only over TLS.
- Use this method rather than
  [LoginWithExtensionAuthentication](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCExtensionAuthentications/LoginWithExtensionAuthentication/index.md),
  which expects encrypted data.

<a id="request"></a>

## Request: StoreExtensionAuthenticationCredentialsRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `target` | `string` | The `id` of the target, from [GetExtensionAuthenticationTargets](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCExtensionAuthentications/GetExtensionAuthenticationTargets/index.md). |
| `authentication_data` | [`ExtensionAuthenticationResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExtensionAuthenticationResponse/index.md) | The credentials. See [ExtensionAuthenticationResponse](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExtensionAuthenticationResponse/index.md). |
| `authentication_data.plugin_configuration` | `string` | The `name` of the authentication method, from the target's `supported_plugins`. |
| `authentication_data.data[]` | repeated [`NamedValue`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.NamedValue/index.md) | The credentials as named text values, as the authentication method expects them. For a user name and password, M-Files clients send `username` and `password`; for tokens, `Token` and `RefreshToken`. |
| `authentication_data.data[].key` | `string` | The name of the value. |
| `authentication_data.data[].value` | [`TypedValue`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.TypedValue/index.md) | The value as a serialized bytearray. |

<a id="response"></a>

## Response: StoreExtensionAuthenticationCredentialsResponse

No fields.

<a id="related"></a>

## Related methods

- [LoginWithExtensionAuthentication](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCExtensionAuthentications/LoginWithExtensionAuthentication/index.md): Logs the caller in to an external system with encrypted credentials.
