AuthenticationService  v0.2.0
Public Member Functions | Properties | List of all members
Joutsen.Authentication.Jwt.JwtPrincipal Class Reference

A prinicipal implementation for users which are authenticated by a JWT token. More...

Public Member Functions

 JwtPrincipal (long id, String username, Set< Role > roles)
 
bool IsInRole (String role)
 Checks if the user has a certain role. More...
 

Properties

long Id [get]
 
String Username [get]
 
Set< RoleRoles [get]
 
IIdentity Identity [get]
 The identity of the user as required by the MVC framework. More...
 
- Properties inherited from Joutsen.Authentication.AuthenticatedUser
long Id [get]
 Fetches the unique identifier of the user. More...
 
String Username [get]
 Fetches the name of the user. More...
 
Set< RoleRoles [get]
 Fetches the user's roles in different applications. More...
 

Detailed Description

A prinicipal implementation for users which are authenticated by a JWT token.

Since
0.1.0

Constructor & Destructor Documentation

◆ JwtPrincipal()

Joutsen.Authentication.Jwt.JwtPrincipal.JwtPrincipal ( long  id,
String  username,
Set< Role roles 
)

Member Function Documentation

◆ IsInRole()

bool Joutsen.Authentication.Jwt.JwtPrincipal.IsInRole ( String  role)

Checks if the user has a certain role.

Property Documentation

◆ Id

long Joutsen.Authentication.Jwt.JwtPrincipal.Id
get

◆ Identity

IIdentity Joutsen.Authentication.Jwt.JwtPrincipal.Identity
get

The identity of the user as required by the MVC framework.

◆ Roles

Set<Role> Joutsen.Authentication.Jwt.JwtPrincipal.Roles
get

◆ Username

String Joutsen.Authentication.Jwt.JwtPrincipal.Username
get