# Server Plugins

Flopsar provides a few functionalities implemented as plugins. These implementations can be easily replaced with user-defined implementations. In this version of Flopsar only `Manager` supports plugins. There is one plugin currently available: *authentication*.

Flopsar provides a C API for writing custom implementations of plugins. In order to write a plugin, you need to include in your project the main header file `plugin.h` , which can be downloaded from our [GitHub repository](https://github.com/flopsar/plugin-api). This file contains prototypes of functions to implement. The function below is the most important one and must be implemented. This function is called only once when the application loads the plugin.

```c
int plugin_init(Plugin *p, const char *p_conf);
```

When you call the function above you will be provided with two arguments. The `p` argument is an opaque type representing your plugin. You should keep it since it is required when you register your plugin hooks. The `p_conf` argument is a path to your plugin configuration file. The second argument is provided only if you specify it during the plugin [installation](/3.0/administrator-guide/server.md#plugins).

{% hint style="warning" %}
Do not change the name of the function above. It must stay `plugin_init`, otherwise a plugin will not be loaded.
{% endhint %}

## Authentication Plugin

If you want to use your own authentication system, you must implement a plugin in order to be able to authenticate your users against this system.&#x20;

There is a default implementation of the authentication plugin available at [GitHub](https://github.com/flopsar/plugin-ldap). Use it as an example to implement your own.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flopsar.com/3.0/developer-guide/server-plugins.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
