Some checks failed
		
		
	
	Build Test Deploy / build-test (push) Has been cancelled
				
			Build Test Deploy / authority-container (push) Has been cancelled
				
			Build Test Deploy / docs (push) Has been cancelled
				
			Build Test Deploy / deploy (push) Has been cancelled
				
			Docs CI / lint-and-preview (push) Has been cancelled
				
			
		
			
				
	
	
		
			17 lines
		
	
	
		
			586 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			586 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System.Security.Claims;
 | |
| using OpenIddict.Abstractions;
 | |
| using static OpenIddict.Abstractions.OpenIddictConstants;
 | |
| 
 | |
| namespace Ablera.Serdica.Authentication.Extensions;
 | |
| 
 | |
| public static class PrincipalBuilder
 | |
| {
 | |
|     public static ClaimsPrincipal Build(string clientId, string authenticationSchema)
 | |
|     {
 | |
|         var claimsIdentity = new ClaimsIdentity(authenticationSchema);
 | |
|         claimsIdentity.AddClaim(Claims.Subject, clientId, Destinations.AccessToken);
 | |
|         var claimsPrincipal = new ClaimsPrincipal(claimsIdentity);
 | |
|         return claimsPrincipal;
 | |
|     }
 | |
| }
 |