public class Auth extends 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(String filter)
Applies an access filter to the current user on the current domain.
|
void |
applyAccessFilter(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(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(String domain,
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.
|
String |
fetchEMail(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.
|
List<de.innovationgate.webgate.api.auth.UserGroupInfo> |
findUsersAndGroups(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.
|
String |
getAccessFilter()
Returns the currently active access filter uid for the domain, null if there is none
|
String |
getAccessFilter(Database db)
Returns the currently active access filter uid on the given database, null if there is none
|
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.
|
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
|
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.
|
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 |
login(String user,
String password)
Login to the domain with user/password credentials
|
boolean |
login(String user,
String password,
String domain)
Login to a domain with user/password credentials
|
boolean |
logout()
Logout from the domain
|
boolean |
logout(String domain)
Logout from a domain
|
de.innovationgate.webgate.api.auth.UserGroupInfo |
lookupDN(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(String user, String password) throws de.innovationgate.webgate.api.WGException
user
- The user namepassword
- The passwordLoginException
de.innovationgate.webgate.api.WGAPIException
UnavailableResourceException
de.innovationgate.webgate.api.WGException
public boolean login(String user, String password, String domain) throws de.innovationgate.webgate.api.WGException
user
- The user namepassword
- The passworddomain
- The domain to login toLoginException
de.innovationgate.webgate.api.WGAPIException
UnavailableResourceException
de.innovationgate.webgate.api.WGException
public boolean logout(String domain) throws de.innovationgate.webgate.api.WGException
domain
- The domain to logout fromde.innovationgate.webgate.api.WGAPIException
UnavailableResourceException
de.innovationgate.webgate.api.WGException
public boolean logout() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGAPIException
UnavailableResourceException
de.innovationgate.webgate.api.WGException
public void changeSessionPassword(String domain, String newPassword) throws de.innovationgate.webgate.api.WGException
domain
- The domainnewPassword
- The new password to useUnavailableResourceException
de.innovationgate.webgate.api.WGException
public void changeSessionPassword(String newPassword) throws de.innovationgate.webgate.api.WGException
newPassword
- The new password to useUnavailableResourceException
de.innovationgate.webgate.api.WGException
public void waitForUpdates(de.innovationgate.webgate.api.WGDatabase db, int timeoutSeconds) throws de.innovationgate.webgate.api.WGException
db
- The authentication content storetimeoutSeconds
- WGAServerException
de.innovationgate.webgate.api.WGException
public void waitForUpdates(int timeoutSeconds) throws de.innovationgate.webgate.api.WGException
timeoutSeconds
- WGAServerException
de.innovationgate.webgate.api.WGException
public de.innovationgate.webgate.api.auth.UserGroupInfo lookupDN(String dn) throws de.innovationgate.webgate.api.WGException
dn
- The distinguished user nameWGAServerException
de.innovationgate.webgate.api.WGQueryException
de.innovationgate.webgate.api.WGException
public String fetchEMail(String user) throws de.innovationgate.webgate.api.WGException
user
- Any user nameWGAServerException
de.innovationgate.webgate.api.WGException
public List<de.innovationgate.webgate.api.auth.UserGroupInfo> findUsersAndGroups(String query) throws de.innovationgate.webgate.api.WGException
query
- The queryWGAServerException
de.innovationgate.webgate.api.WGQueryException
de.innovationgate.webgate.api.WGException
public de.innovationgate.webgate.api.auth.AuthenticationModule getModule()
public String getSessionUser() throws de.innovationgate.webgate.api.WGException
UnavailableResourceException
de.innovationgate.webgate.api.WGException
public Object getSessionCredentials() throws de.innovationgate.webgate.api.WGException
UnavailableResourceException
de.innovationgate.webgate.api.WGException
public void applyAccessFilter(String filter) throws de.innovationgate.webgate.api.WGException
filter
- The uid of the filter do applyde.innovationgate.webgate.api.WGException
public void applyAccessFilter(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.WGException
public String getAccessFilter() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public String getAccessFilter(Database db) throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public void removeAccessFilter() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public void removeAccessFilter(Database db) throws de.innovationgate.webgate.api.WGException
db
- The database to remove the filter fromde.innovationgate.webgate.api.WGException
public String getLoginName() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public String getAuthenticationType() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException