public class MockWindowsAuthProvider extends Object implements IWindowsAuthProvider
Constructor and Description |
---|
MockWindowsAuthProvider()
Instantiates a new mock windows auth provider.
|
Modifier and Type | Method and Description |
---|---|
IWindowsSecurityContext |
acceptSecurityToken(String connectionId,
byte[] token,
String securityPackage)
Attempts to validate the user using an SSPI token.
|
void |
addGroup(String name)
Adds the group.
|
IWindowsComputer |
getCurrentComputer()
Retrieve the current computer information.
|
IWindowsDomain[] |
getDomains()
Retrieve a list of domains (Active Directory) on the local server.
|
IWindowsIdentity |
logonDomainUser(String username,
String domain,
String password)
The LogonDomainUser function attempts to log a user on to the local computer using a network logon type and the
default authentication provider.
|
IWindowsIdentity |
logonDomainUserEx(String username,
String domain,
String password,
int logonType,
int logonProvider)
The LogonDomainUserEx function attempts to log a user on to the local computer.
|
IWindowsIdentity |
logonUser(String username,
String password)
Will login the current user with any password.
|
IWindowsAccount |
lookupAccount(String username)
Retrieve a security identifier (SID) for the account and the name of the domain or local computer on which the
account was found.
|
void |
resetSecurityToken(String connectionId)
Reset a previously saved continuation security token for a given connection id.
|
public MockWindowsAuthProvider()
public void addGroup(String name)
name
- the namepublic IWindowsSecurityContext acceptSecurityToken(String connectionId, byte[] token, String securityPackage)
IWindowsAuthProvider
acceptSecurityToken
in interface IWindowsAuthProvider
connectionId
- A unique connection id.token
- The security token generated by the client wishing to logon.securityPackage
- The name of the security package to use. Can be any security package supported by both the client and
the server. This is usually set to "Negotiate" which will use SPNEGO to determine which security
package to use. Other common values are "Kerberos" and "NTLM".public IWindowsComputer getCurrentComputer()
IWindowsAuthProvider
getCurrentComputer
in interface IWindowsAuthProvider
public IWindowsDomain[] getDomains()
IWindowsAuthProvider
getDomains
in interface IWindowsAuthProvider
public IWindowsIdentity logonDomainUser(String username, String domain, String password)
IWindowsAuthProvider
logonDomainUser
in interface IWindowsAuthProvider
username
- A string that specifies the name of the user. This is the name of the user account to log on to. If
you use the user principal name (UPN) format, user@DNS_domain_name, the domain parameter must be NULL.domain
- A string that specifies the name of the domain or server whose account database contains the username
account. If this parameter is NULL, the user name must be specified in UPN format. If this parameter
is ".", the function validates the account by using only the local account database.password
- A string that specifies the plaintext password for the user account specified by username.public IWindowsIdentity logonDomainUserEx(String username, String domain, String password, int logonType, int logonProvider)
IWindowsAuthProvider
logonDomainUserEx
in interface IWindowsAuthProvider
username
- A string that specifies the name of the user. This is the name of the user account to log on to. If
you use the user principal name (UPN) format, user@DNS_domain_name, the domain parameter must be NULL.domain
- A string that specifies the name of the domain or server whose account database contains the username
account. If this parameter is NULL, the user name must be specified in UPN format. If this parameter
is ".", the function validates the account by using only the local account database.password
- A string that specifies the plaintext password for the user account specified by username.logonType
- The type of logon operation to perform.logonProvider
- Specifies the logon provider.public IWindowsIdentity logonUser(String username, String password)
logonUser
in interface IWindowsAuthProvider
username
- the usernamepassword
- the passwordpublic IWindowsAccount lookupAccount(String username)
IWindowsAuthProvider
lookupAccount
in interface IWindowsAuthProvider
username
- Fully qualified or partial username.public void resetSecurityToken(String connectionId)
IWindowsAuthProvider
resetSecurityToken
in interface IWindowsAuthProvider
connectionId
- Connection id.Copyright © 2010–2015 com.github.dblock. All rights reserved.