mirror of
				https://github.com/esiur/esiur-dotnet.git
				synced 2025-10-29 23:21:36 +00:00 
			
		
		
		
	auth
This commit is contained in:
		
							
								
								
									
										13
									
								
								Esiur/Security/Membership/AuthorizationResponse.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								Esiur/Security/Membership/AuthorizationResponse.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| using Esiur.Security.Authority; | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Text; | ||||
|  | ||||
| namespace Esiur.Security.Membership | ||||
| { | ||||
|     public class AuthorizationResponse | ||||
|     { | ||||
|         public Session Session { get; set; } | ||||
|         public bool Succeeded { get; set; } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										16
									
								
								Esiur/Security/Membership/AuthorizationResults.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								Esiur/Security/Membership/AuthorizationResults.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Text; | ||||
|  | ||||
| namespace Esiur.Security.Membership | ||||
| { | ||||
|     public class AuthorizationResults | ||||
|     { | ||||
|         AuthorizationResultsResponse Response { get; set; } | ||||
|         TwoFactorAuthorizationMethod TwoFactorMethod { get; set; } | ||||
|         public string Clue { get; set; } | ||||
|         public string AppName { get; set; } | ||||
|         public string Code { get; set; } | ||||
|         public int Timeout { get; set; } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										13
									
								
								Esiur/Security/Membership/AuthorizationResultsResponse.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								Esiur/Security/Membership/AuthorizationResultsResponse.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Text; | ||||
|  | ||||
| namespace Esiur.Security.Membership | ||||
| { | ||||
|     public enum AuthorizationResultsResponse | ||||
|     { | ||||
|         Success, | ||||
|         ServiceUnavailable, | ||||
|         TwoFactoryAuthorization, | ||||
|     } | ||||
| } | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|   | ||||
| Copyright (c) 2017 Ahmed Kh. Zamil | ||||
| Copyright (c) 2017-2024 Ahmed Kh. Zamil | ||||
|  | ||||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
| of this software and associated documentation files (the "Software"), to deal | ||||
| @@ -37,11 +37,17 @@ namespace Esiur.Security.Membership; | ||||
|  | ||||
| public interface IMembership | ||||
| { | ||||
|     public event ResourceEventHandler<AuthorizationResponse> Authorization; | ||||
|  | ||||
|     AsyncReply<bool> UserExists(string username, string domain); | ||||
|     AsyncReply<byte[]> GetPassword(string username, string domain); | ||||
|     AsyncReply<byte[]> GetToken(ulong tokenIndex, string domain); | ||||
|     AsyncReply<AuthorizationResults> Authorize(Session session); | ||||
|     AsyncReply<bool> Login(Session session); | ||||
|     AsyncReply<bool> Logout(Session session); | ||||
|     bool GuestsAllowed { get; } | ||||
|     AsyncReply<string> TokenExists(ulong tokenIndex, string domain); | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
|   | ||||
							
								
								
									
										15
									
								
								Esiur/Security/Membership/TwoFactorAuthorizationMethod.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								Esiur/Security/Membership/TwoFactorAuthorizationMethod.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Text; | ||||
|  | ||||
| namespace Esiur.Security.Membership | ||||
| { | ||||
|     public enum TwoFactorAuthorizationMethod | ||||
|     { | ||||
|         Email, | ||||
|         SMS, | ||||
|         App, | ||||
|     } | ||||
|  | ||||
|  | ||||
| } | ||||
		Reference in New Issue
	
	Block a user