Top Description Methods
waffle.windows.auth

public Interface IWindowsAuthProvider

Known Direct Implementers
waffle.windows.auth.impl.WindowsAuthProviderImpl

Implements Windows authentication functions.
Author
dblock[at]dblock[dot]org

Method Summary

Modifier and TypeMethod and Description
public IWindowsSecurityContext

Returns:

Windows account.
acceptSecurityToken
(final String
A unique connection id.
connectionId
,
final byte[]
The security token generated by the client wishing to logon.
token
,
final String
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".
securityPackage
)

Attempts to validate the user using an SSPI token.

public IWindowsComputer

Returns:

Current computer information.
getCurrentComputer
()

Retrieve the current computer information.

public IWindowsDomain[]

Returns:

A list of domains.
getDomains
()

Retrieve a list of domains (Active Directory) on the local server.

public IWindowsIdentity

Returns:

Windows identity.
logonDomainUser
(final String
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.
username
,
final String
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.
domain
,
final String
A string that specifies the plaintext password for the user account specified by username.
password
)

The LogonDomainUser function attempts to log a user on to the local computer using a network logon type and the default authentication provider.

public IWindowsIdentity

Returns:

Windows identity.
logonDomainUserEx
(final String
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.
username
,
final String
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.
domain
,
final String
A string that specifies the plaintext password for the user account specified by username.
password
,
final int
The type of logon operation to perform.
logonType
,
final int
Specifies the logon provider.
logonProvider
)

The LogonDomainUserEx function attempts to log a user on to the local computer.

public IWindowsIdentity

Returns:

Windows identity.
logonUser
(final String
A string that specifies the name of the user in the UPN format.
username
,
final String
A string that specifies the plaintext password for the user account specified by username.
password
)

The LogonUser function attempts to log a user on to the local computer using a network logon type and the default authentication provider.

public IWindowsAccount

Returns:

Windows account.
lookupAccount
(final String
Fully qualified or partial username.
username
)

Retrieve a security identifier (SID) for the account and the name of the domain or local computer on which the account was found.

public void
resetSecurityToken(final String
Connection id.
connectionId
)

Reset a previously saved continuation security token for a given connection id.

Method Detail

acceptSecurityTokenback to summary
public IWindowsSecurityContext acceptSecurityToken(final String connectionId, final byte[] token, final String securityPackage)

Attempts to validate the user using an SSPI token. This token is generated by the client via the InitializeSecurityContext(package) method described in https://msdn.microsoft.com/en-us/library/aa375509(VS.85).aspx

Parameters
connectionId:String

A unique connection id.

token:byte[]

The security token generated by the client wishing to logon.

securityPackage:String

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".

Returns:IWindowsSecurityContext

Windows account.

getCurrentComputerback to summary
public IWindowsComputer getCurrentComputer()

Retrieve the current computer information.

Returns:IWindowsComputer

Current computer information.

getDomainsback to summary
public IWindowsDomain[] getDomains()

Retrieve a list of domains (Active Directory) on the local server.

Returns:IWindowsDomain[]

A list of domains.

logonDomainUserback to summary
public IWindowsIdentity logonDomainUser(final String username, final String domain, final 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.

Parameters
username:String

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:String

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:String

A string that specifies the plaintext password for the user account specified by username.

Returns:IWindowsIdentity

Windows identity.

logonDomainUserExback to summary
public IWindowsIdentity logonDomainUserEx(final String username, final String domain, final String password, final int logonType, final int logonProvider)

The LogonDomainUserEx function attempts to log a user on to the local computer. The local computer is the computer from which LogonUser was called. You cannot use LogonUser to log on to a remote computer. You specify the user with a user name and domain and authenticate the user with a plaintext password.

Parameters
username:String

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:String

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:String

A string that specifies the plaintext password for the user account specified by username.

logonType:int

The type of logon operation to perform.

logonProvider:int

Specifies the logon provider.

Returns:IWindowsIdentity

Windows identity.

logonUserback to summary
public IWindowsIdentity logonUser(final String username, final String password)

The LogonUser function attempts to log a user on to the local computer using a network logon type and the default authentication provider.

Parameters
username:String

A string that specifies the name of the user in the UPN format.

password:String

A string that specifies the plaintext password for the user account specified by username.

Returns:IWindowsIdentity

Windows identity.

lookupAccountback to summary
public IWindowsAccount lookupAccount(final 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.

Parameters
username:String

Fully qualified or partial username.

Returns:IWindowsAccount

Windows account.

resetSecurityTokenback to summary
public void resetSecurityToken(final String connectionId)

Reset a previously saved continuation security token for a given connection id.

Parameters
connectionId:String

Connection id.