Interface IAuthenticator
A general interface for authenticating logging into the LemonEdge platform
Namespace: LemonEdge.API.Core.Context
Assembly: LemonEdge.API.dll
Syntax
public interface IAuthenticator
Methods
ForceUpgrade(string)
If you are connected directly to the database this will attempt to force an upgrade of the database if the database has current state of being upgraded.
This can only be used in cases of direct database connection, and should only be used when you know the current upgrading process has failed or crashed, and that this process should attempt the upgrade instead
It will not perform an upgrade if the database is not stuck being marked as upgrading, or if you are not directly connected to it.Declaration
Task<bool> ForceUpgrade(string source)
Parameters
Type | Name | Description |
---|---|---|
string | source |
Returns
Type | Description |
---|---|
Task<bool> | Indicates if the upgrade worked |
GetAppServiceVersion()
Returns the app service version of the connected database to indicate compatibility
Declaration
Task<Version> GetAppServiceVersion()
Returns
Type | Description |
---|---|
Task<Version> | The appservice version of the connected database to indicate compatibility |
GetClientLoginSettings()
Gets Client Settings. For a service this means the currently configured auth token handlers, plus Windows negotiate, if configured. For local db connection, this means Windows auth and or username and password.
Declaration
Task<ClientAuthenticationSettings> GetClientLoginSettings()
Returns
Type | Description |
---|---|
Task<ClientAuthenticationSettings> | A ClientAuthenticationSettings object |
GetDatabaseName()
Returns the name of the database that backs this service.
Declaration
Task<string> GetDatabaseName()
Returns
Type | Description |
---|---|
Task<string> |
GetLoginProviders()
Gets the login providers. For a service this means the currently configured auth token handlers, plus Windows negotiate, if configured. For local db connection, this means Windows auth and or username and password.
Declaration
[Obsolete]
Task<string[]> GetLoginProviders()
Returns
Type | Description |
---|---|
Task<string[]> | A string array of the supported keys |
Login(string, string)
Specifies to login into the system using the specified username/password login
Declaration
Task<UserInfo> Login(string userName, string password)
Parameters
Type | Name | Description |
---|---|---|
string | userName | The unique username to login to the system with |
string | password | The password |
Returns
Type | Description |
---|---|
Task<UserInfo> | If the user successfully logs in then the system returns a new random and unique session id for this user to use. Otherwise no id is returned and an error is thrown |
LoginExternalUser(string, IPAddress)
Specifies to login into the system using a token from an external provider.
Declaration
Task<UserInfo> LoginExternalUser(string email = null, IPAddress ipAddress = null)
Parameters
Type | Name | Description |
---|---|---|
string | ||
IPAddress | ipAddress |
Returns
Type | Description |
---|---|
Task<UserInfo> | If the user successfully logs in then the system returns a UserInfo. Otherwise no id is returned and an error is thrown |
LoginWindowsUser(string, IPAddress)
Specifies to login into the system using the specified windows authentication login
Declaration
Task<UserInfo> LoginWindowsUser(string email = null, IPAddress ipAddress = null)
Parameters
Type | Name | Description |
---|---|---|
string | ||
IPAddress | ipAddress |
Returns
Type | Description |
---|---|
Task<UserInfo> | If the user successfully logs in then the system returns a UserInfo. Otherwise no id is returned and an error is thrown |