---
lang: en
title: 'API docs: security.defaultsubject'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/security
permalink: /doc/en/lb4/apidocs.security.defaultsubject.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/security](./security.md) &gt; [DefaultSubject](./security.defaultsubject.md)

## DefaultSubject class

Default implementation of `Subject`

**Signature:**

```typescript
export declare class DefaultSubject implements Subject 
```
**Implements:** [Subject](./security.subject.md)

## Properties

<table><thead><tr><th>

Property


</th><th>

Modifiers


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[authorities](./security.defaultsubject.authorities.md)


</td><td>

`readonly`


</td><td>

Set&lt;[Permission](./security.permission.md)<!-- -->&gt;


</td><td>


</td></tr>
<tr><td>

[credentials](./security.defaultsubject.credentials.md)


</td><td>

`readonly`


</td><td>

Set&lt;[Credential](./security.credential.md)<!-- -->&gt;


</td><td>


</td></tr>
<tr><td>

[principals](./security.defaultsubject.principals.md)


</td><td>

`readonly`


</td><td>

Set&lt;[TypedPrincipal](./security.typedprincipal.md)<!-- -->&gt;


</td><td>


</td></tr>
<tr><td>

[user](./security.defaultsubject.user.md)


</td><td>

`readonly`


</td><td>

[UserProfile](./security.userprofile.md) \| undefined


</td><td>


</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[addApplication(app)](./security.defaultsubject.addapplication.md)


</td><td>


</td><td>


</td></tr>
<tr><td>

[addAuthority(authorities)](./security.defaultsubject.addauthority.md)


</td><td>


</td><td>


</td></tr>
<tr><td>

[addCredential(credentials)](./security.defaultsubject.addcredential.md)


</td><td>


</td><td>


</td></tr>
<tr><td>

[addUser(users)](./security.defaultsubject.adduser.md)


</td><td>


</td><td>


</td></tr>
<tr><td>

[getPrincipal(type)](./security.defaultsubject.getprincipal.md)


</td><td>


</td><td>


</td></tr>
</tbody></table>

