> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mastermindcms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# UserPrincipalDetailsService

> Calling public service methods through the REST API: userPrincipalDetailsService

<ResponseField name="beanId" type="string">
  The Spring bean identifier containing the service being called.

  userPrincipalDetailsService
</ResponseField>

<ResponseField name="scope" type="string" default="PROTOTYPE">
  Bean scope. Use PROTOTYPE for service calls.
</ResponseField>

<ResponseField name="functionName" type="string">
  The public service method name shown in the signature below.
</ResponseField>

<ResponseField name="args" type="object[]">
  The method argument array. Each argument is passed as an object with index 0, 1, and so on; the value must match the Java parameter type.
</ResponseField>

## Headers

```http theme={null}
POST /api/v1/bean/request
Content-Type: application/json
Lang-Context: en
Site-Context: my-site
Authorization: Bearer <token>
```

Send `Lang-Context` and `Site-Context` with every request. For protected methods, send the JWT in the `Authorization` header as `Bearer <token>`.

**Access:** USER or ADMIN. **Bearer Token:** required.

* GUEST — unauthenticated users; only whitelist services are available.
* USER — authentication is required; methods with USER checks are available.
* ADMIN — full access to public methods of all services.
* If a method checks a role internally, GUEST may receive null.

## Methods

<ResponseField name="loadUserByUsername" type="UserDetails">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `s`      | `String` | Passed through `args[0].0`. |

  ### loadUserByUsername

  ```json theme={null}
  {
    "beanId": "userPrincipalDetailsService",
    "scope": "PROTOTYPE",
    "functionName": "loadUserByUsername",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="loadAuditSettings" type="Optional<UserAuditSettings>">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `id`     | `String` | Passed through `args[0].0`. |

  ### loadAuditSettings

  ```json theme={null}
  {
    "beanId": "userPrincipalDetailsService",
    "scope": "PROTOTYPE",
    "functionName": "loadAuditSettings",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="deleteAuditSettings" type="void">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `id`     | `String` | Passed through `args[0].0`. |

  ### deleteAuditSettings

  ```json theme={null}
  {
    "beanId": "userPrincipalDetailsService",
    "scope": "PROTOTYPE",
    "functionName": "deleteAuditSettings",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="userHasAccessToPage" type="boolean">
  | Argument     | Type     | Description                 |
  | ------------ | -------- | --------------------------- |
  | `site`       | `String` | Passed through `args[0].0`. |
  | `login`      | `String` | Passed through `args[1].1`. |
  | `requestURI` | `String` | Passed through `args[2].2`. |

  ### userHasAccessToPage

  ```json theme={null}
  {
    "beanId": "userPrincipalDetailsService",
    "scope": "PROTOTYPE",
    "functionName": "userHasAccessToPage",
    "args": [
      {
        "0": null,
        "1": null,
        "2": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="loadRememberMeToken" type="AuthenticationToken">
  | Argument   | Type     | Description                 |
  | ---------- | -------- | --------------------------- |
  | `username` | `String` | Passed through `args[0].0`. |

  ### loadRememberMeToken

  ```json theme={null}
  {
    "beanId": "userPrincipalDetailsService",
    "scope": "PROTOTYPE",
    "functionName": "loadRememberMeToken",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>
