> ## 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.

# JWTServiceImpl

> Calling public service methods through the REST API: jWTServiceImpl

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

  JWTServiceImpl
</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:** 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="extractUsername" type="String">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `token`  | `String` | Passed through `args[0].0`. |

  ### extractUsername

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

<ResponseField name="getExpirationTime" type="long">
  | Argument | Type | Description                            |
  | -------- | ---- | -------------------------------------- |
  | —        | —    | This method does not accept arguments. |

  ### getExpirationTime

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

<ResponseField name="isTokenExpired" type="boolean">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `token`  | `String` | Passed through `args[0].0`. |

  ### isTokenExpired

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

<ResponseField name="extractExpiration" type="Date">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `token`  | `String` | Passed through `args[0].0`. |

  ### extractExpiration

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

<ResponseField name="extractAllClaims" type="Claims">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `token`  | `String` | Passed through `args[0].0`. |

  ### extractAllClaims

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

<ResponseField name="getSignInKey" type="Key">
  | Argument | Type | Description                            |
  | -------- | ---- | -------------------------------------- |
  | —        | —    | This method does not accept arguments. |

  ### getSignInKey

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