public class Auth
extends java.lang.Object
WGA.auth() returns an object without a domain in context which therefor will not be able to provide domain-specific services.| Modifier and Type | Method and Description |
|---|---|
void |
applyAccessFilter(java.lang.String filter)
Applies an access filter to the current user on the current domain.
|
void |
applyAccessFilter(java.lang.String filter,
Database db)
Applies an access filter to the current user only on given database
This will implicitly reopen an open session on that database, so that the filter is immediately active
|
void |
changeSessionPassword(java.lang.String newPassword)
Change a password that is used to authenticate on the domain for the current session
This method should be used on "password self service" applications where users are able to change their login password on the authentication backend.
|
void |
changeSessionPassword(java.lang.String domain,
java.lang.String newPassword)
Change a password that is used to authenticate on a domain for the current session
This method should be used on "password self service" applications where users are able to change their login password on the authentication backend.
|
java.lang.String |
fetchEMail(java.lang.String user)
Fetches the eMail address for a user from the authentication backend
This is a service whose availability depends on the Authentication source in use but should be available for most.
|
java.util.List<de.innovationgate.webgate.api.auth.UserGroupInfo> |
findUsersAndGroups(java.lang.String query)
Searches for users and groups on the authentication backend
This is an optional service of authentication sources that allows to search for users and groups that are known to the backend by providing a query.
|
java.lang.String |
getAccessFilter()
Returns the currently active access filter uid for the domain, null if there is none
|
java.lang.String |
getAccessFilter(Database db)
Returns the currently active access filter uid on the given database, null if there is none
|
java.lang.String |
getAuthenticationType()
Returns the type of authentication that the user used to authenticate to the current domain. null if the user is not logged in.
|
java.lang.String |
getLoginName()
Returns the name by which the user is logged into this domain, null if he isn't
|
de.innovationgate.webgate.api.auth.AuthenticationModule |
getModule()
Returns the WGAPI authentication module backing this authentication
|
java.lang.Object |
getSessionCredentials()
Returns the credentials by which the current user is logged in to this domain
When using regular user/password authentication this will return a string password.
|
java.lang.String |
getSessionUser()
Returns the user name by which the current user is logged in to the current domain
This is the user name as it came from the authentication process, for example via a manual login on some login page.
|
boolean |
isAnonymous()
Returns if the user is currently anonymous
|
boolean |
login(java.lang.String user,
de.innovationgate.webgate.api.auth.CustomCredentials creds)
Login to the domain with user/password credentials
|
boolean |
login(java.lang.String user,
de.innovationgate.webgate.api.auth.CustomCredentials creds,
java.lang.String domain)
Login to a domain with user/password credentials
|
boolean |
login(java.lang.String user,
java.lang.String password)
Login to the domain with plain user/password
|
boolean |
login(java.lang.String user,
java.lang.String password,
java.lang.String domain)
Login to a domain with plain user/password
|
boolean |
logout()
Logout from the domain
|
boolean |
logout(java.lang.String domain)
Logout from a domain
|
de.innovationgate.webgate.api.auth.UserGroupInfo |
lookupDN(java.lang.String dn)
Looks up user information by a distinguished user name
|
void |
removeAccessFilter()
Removes a currently active access filter on the domain
|
void |
removeAccessFilter(Database db)
Removes a currently active access filter on the given database
|
void |
waitForUpdates(int timeoutSeconds)
Waits until updates on the authentication content store of the current domain are effective
This is a rather special method for use in the UI of authentication applications, whose content stores store data about users and groups for login.
|
void |
waitForUpdates(de.innovationgate.webgate.api.WGDatabase db,
int timeoutSeconds)
Waits until updates on an authentication content store are effective
This is a rather special method for use in the UI of authentication applications, whose content stores store data about users and groups for login.
|
public boolean login(java.lang.String user,
java.lang.String password)
throws de.innovationgate.webgate.api.WGException
user - The user namepassword - The passwordLoginExceptionde.innovationgate.webgate.api.WGAPIExceptionUnavailableResourceExceptionde.innovationgate.webgate.api.WGExceptionpublic boolean login(java.lang.String user,
java.lang.String password,
java.lang.String domain)
throws de.innovationgate.webgate.api.WGException
user - The user namepassword - The passworddomain - The domain to login toLoginExceptionde.innovationgate.webgate.api.WGAPIExceptionUnavailableResourceExceptionde.innovationgate.webgate.api.WGExceptionpublic boolean login(java.lang.String user,
de.innovationgate.webgate.api.auth.CustomCredentials creds)
throws de.innovationgate.webgate.api.WGException
user - The user namecreds - The credentialsLoginExceptionde.innovationgate.webgate.api.WGAPIExceptionUnavailableResourceExceptionde.innovationgate.webgate.api.WGExceptionpublic boolean login(java.lang.String user,
de.innovationgate.webgate.api.auth.CustomCredentials creds,
java.lang.String domain)
throws de.innovationgate.webgate.api.WGException
user - The user namecreds - The credentialsdomain - The domain to login toLoginExceptionde.innovationgate.webgate.api.WGAPIExceptionUnavailableResourceExceptionde.innovationgate.webgate.api.WGExceptionpublic boolean logout(java.lang.String domain)
throws de.innovationgate.webgate.api.WGException
domain - The domain to logout fromde.innovationgate.webgate.api.WGAPIExceptionUnavailableResourceExceptionde.innovationgate.webgate.api.WGExceptionpublic boolean logout()
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGAPIExceptionUnavailableResourceExceptionde.innovationgate.webgate.api.WGExceptionpublic void changeSessionPassword(java.lang.String domain,
java.lang.String newPassword)
throws de.innovationgate.webgate.api.WGException
domain - The domainnewPassword - The new password to useUnavailableResourceExceptionde.innovationgate.webgate.api.WGExceptionpublic void changeSessionPassword(java.lang.String newPassword)
throws de.innovationgate.webgate.api.WGException
newPassword - The new password to useUnavailableResourceExceptionde.innovationgate.webgate.api.WGExceptionpublic void waitForUpdates(de.innovationgate.webgate.api.WGDatabase db,
int timeoutSeconds)
throws de.innovationgate.webgate.api.WGException
db - The authentication content storetimeoutSeconds - WGAServerExceptionde.innovationgate.webgate.api.WGExceptionpublic void waitForUpdates(int timeoutSeconds)
throws de.innovationgate.webgate.api.WGException
timeoutSeconds - WGAServerExceptionde.innovationgate.webgate.api.WGExceptionpublic de.innovationgate.webgate.api.auth.UserGroupInfo lookupDN(java.lang.String dn)
throws de.innovationgate.webgate.api.WGException
dn - The distinguished user nameWGAServerExceptionde.innovationgate.webgate.api.WGQueryExceptionde.innovationgate.webgate.api.WGExceptionpublic java.lang.String fetchEMail(java.lang.String user)
throws de.innovationgate.webgate.api.WGException
user - Any user nameWGAServerExceptionde.innovationgate.webgate.api.WGExceptionpublic java.util.List<de.innovationgate.webgate.api.auth.UserGroupInfo> findUsersAndGroups(java.lang.String query)
throws de.innovationgate.webgate.api.WGException
query - The queryWGAServerExceptionde.innovationgate.webgate.api.WGQueryExceptionde.innovationgate.webgate.api.WGExceptionpublic de.innovationgate.webgate.api.auth.AuthenticationModule getModule()
public java.lang.String getSessionUser()
throws de.innovationgate.webgate.api.WGException
UnavailableResourceExceptionde.innovationgate.webgate.api.WGExceptionpublic java.lang.Object getSessionCredentials()
throws de.innovationgate.webgate.api.WGException
UnavailableResourceExceptionde.innovationgate.webgate.api.WGExceptionpublic void applyAccessFilter(java.lang.String filter)
throws de.innovationgate.webgate.api.WGException
filter - The uid of the filter do applyde.innovationgate.webgate.api.WGExceptionpublic void applyAccessFilter(java.lang.String filter,
Database db)
throws de.innovationgate.webgate.api.WGException
filter - The uid of the filter do applydb - The database on which the filter should be appliedde.innovationgate.webgate.api.WGExceptionpublic java.lang.String getAccessFilter()
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic java.lang.String getAccessFilter(Database db) throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic void removeAccessFilter()
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic void removeAccessFilter(Database db) throws de.innovationgate.webgate.api.WGException
db - The database to remove the filter fromde.innovationgate.webgate.api.WGExceptionpublic java.lang.String getLoginName()
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic java.lang.String getAuthenticationType()
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic boolean isAnonymous()
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException