> For the complete documentation index, see [llms.txt](https://docs.medcrypt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.medcrypt.com/medcrypt-documentation/guardian/api-overview/api-reference/classes/classmedcrypt-guardian-authenticationmanager.md).

# medcrypt::guardian::AuthenticationManager

Container for authentication restrictions.

`#include <AuthenticationManager.h>`

## Public functions

<table data-header-hidden><thead><tr><th>Name</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>Name</td><td></td><td></td></tr><tr><td><a href="#function-~authenticationmanager"><strong>~AuthenticationManager</strong></a>()</td><td>This is the destructor.</td><td></td></tr><tr><td><a href="#function-getrestrictions"><strong>GetRestrictions</strong></a>(std::list&#x3C; <a href="/medcrypt-documentation/guardian/api-overview/api-reference/classes/structmedcrypt-guardian-authenticationdomain.md">AuthenticationDomain</a> > * out_restrictions_by_domain)</td><td>This gets all restrictions.</td><td><a href="/medcrypt-documentation/guardian/api-overview/api-reference/namespaces/namespacemedcrypt-guardian.md#typedef-status">Status</a></td></tr><tr><td><a href="#function-getrestrictionbyservice"><strong>GetRestrictionByService</strong></a>(const char <em>in_service_name,</em> <a href="/medcrypt-documentation/guardian/api-overview/api-reference/classes/structmedcrypt-guardian-authenticationdomain.md"><em>AuthenticationDomain</em></a> out_restriction)</td><td>This gets all restrictions by service.</td><td><a href="/medcrypt-documentation/guardian/api-overview/api-reference/namespaces/namespacemedcrypt-guardian.md#typedef-status">Status</a></td></tr></tbody></table>

### function \~AuthenticationManager

```cpp
~AuthenticationManager()
```

The destructor.

**Parameters**:

* **none**

**Return**: none

The destructor does no work.

### function GetRestrictions

```cpp
Status GetRestrictions(
    std::list< AuthenticationDomain > * out_restrictions_by_domain
)
```

Get all restrictions.

**Parameters**:

* **out\_restrictions\_by\_domain** list of domains and their restrictions,

**Returns**:

* **OK** out\_restrictions\_by\_domain is populated with restrictions
* **FAIL** general failure, out\_restrictions\_by\_domain is unmodified
* **BADPARAM** out\_restrictions\_by\_domain is nullptr

**Return**: [medcrypt::guardian::Status](/medcrypt-documentation/guardian/api-overview/api-reference/namespaces/namespacemedcrypt-guardian.md#typedef-status)

Returns a list of all AuthenticationRestrictions in the system.

### function GetRestrictionByService

```cpp
Status GetRestrictionByService(
    const char * in_service_name,
    AuthenticationDomain * out_restriction
)
```

Get restrictions by service.

**Parameters**:

* **in\_service\_name** null terminated string of service name
* **out\_restriction** restriction set for in\_service\_name

**Returns**:

* **OK** out\_restriction is populated with restrictions for in\_service\_name
* **FAIL** general failure, out\_restriction is unmodified
* **BADPARAM** in\_service\_name is nullptr or empty, or out\_restriction is nullptr
* **MISCONFIGURED** in\_service\_name cannot be found or is not configured to share restrictions

**Return**: [medcrypt::guardian::Status](/medcrypt-documentation/guardian/api-overview/api-reference/namespaces/namespacemedcrypt-guardian.md#typedef-status)

Returns a single AuthenticationRestriction for the specified service name

## Debugging and logging

Guardian does not create log files. Instead, logging is controlled by the application:

* Guardian logs to `stdout` and `stderr`, which appear in the terminal/CLI of the running application during execution. Look for specific error codes or connection failures in the output.
* **Custom logging:** Use `SetLoggingCallback` to redirect log messages to a callback function, stopping terminal output and allowing custom log handling
* **Log control:** Applications can control log level and verbosity.
* **Guardian Cloud UI**: Check the Guardian Cloud interface for additional error details and provisioning status.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.medcrypt.com/medcrypt-documentation/guardian/api-overview/api-reference/classes/classmedcrypt-guardian-authenticationmanager.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
