AuthenticationService v0.3.0+7-g8a7f190
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 (object id, String username, Set< Role > roles)
 
bool IsInRole (String role)
 Checks if the user has a certain role. More...
 

Properties

object 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...
 
IIdentity Identity [get]
 The identity of the user as required by the MVC framework. More...
 
- Properties inherited from Joutsen.Authentication.AuthenticatedUser
object 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 ( object  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

object Joutsen.Authentication.Jwt.JwtPrincipal.Id
get

Fetches the unique identifier of the user.

Implements Joutsen.Authentication.AuthenticatedUser.

◆ 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

Fetches the user's roles in different applications.

Implements Joutsen.Authentication.AuthenticatedUser.

◆ Username

String Joutsen.Authentication.Jwt.JwtPrincipal.Username
get

Fetches the name of the user.

Implements Joutsen.Authentication.AuthenticatedUser.