---
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`

<b>Signature:</b>

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

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [authorities](./security.defaultsubject.authorities.md) |  | Set&lt;[Permission](./security.permission.md)<!-- -->&gt; |  |
|  [credentials](./security.defaultsubject.credentials.md) |  | Set&lt;[Credential](./security.credential.md)<!-- -->&gt; |  |
|  [principals](./security.defaultsubject.principals.md) |  | Set&lt;[TypedPrincipal](./security.typedprincipal.md)<!-- -->&gt; |  |
|  [user](./security.defaultsubject.user.md) |  | [UserProfile](./security.userprofile.md) \| undefined |  |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [addApplication(app)](./security.defaultsubject.addapplication.md) |  |  |
|  [addAuthority(authorities)](./security.defaultsubject.addauthority.md) |  |  |
|  [addCredential(credentials)](./security.defaultsubject.addcredential.md) |  |  |
|  [addUser(users)](./security.defaultsubject.adduser.md) |  |  |
|  [getPrincipal(type)](./security.defaultsubject.getprincipal.md) |  |  |


