Page History
...
Expand | |||||
---|---|---|---|---|---|
| |||||
This function validates a Yellowfin user. It accepts AdministrationPerson as a parameter where you can provide user ID (email address or Id another ID depending on the Login ID method) and password to identify the user. The response will be SUCCESS if the user with provided details exists. The Otherwise the response will return code 25 (COULD_NOT_AUTHENTICATE_USER) if the user is not valid.
|
| |||||||||||||||||||||||||||||||||||||||
Expand | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||
The following code will call the Yellowfin web service to validate a user’s password: Code Block |
This code will check if the password is expired and will return This function will validate a Yellowfin user’s password. The details in the AdministrationPerson object will be used in the password validation process.
These are the parameters that you need to set in the AdministrationPerson object:
The response returned will contain these parameters: | ||||||||||||||||||||||||||||||||||||||
Response Element | Data Type | Description | StatusCode | String |
setOrgRef("org1"); |
If the OrgRef parameter is omitted, the user will be validated against the default (primary) organization.
Once the request is configured, perform the call:
Code Block language java AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
Initialize the Administration web service. Click here to learn how to do this.
The response will contain these parameters:
Response Element
Data Type
Description
StatusCode
String
Status of the web service call. Possible values include:
- SUCCESS
- FAILURE
Complete Example
Below is a complete example of the VALIDATEUSER function. To use it for yourself, carry out the following the steps:
- Copy the code and save it as ws_validateuser.jsp.
- Put the file in the Yellowfin/appserver/webapps/ROOT folder.
- Adjust the host, port, admin user and user to validate according to your environment.
- Run http://<host>:<port>/ws_validateuser.jsp from your Internet browser.
Code Block | ||
---|---|---|
| ||
<%
/* ws_validateuser.jsp */
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="com.hof.util.*, java.util.*, java.text.*" %>
<%@ page import="com.hof.web.form.*" %>
<%@ page import="com.hof.mi.web.service.*" %>
<%
AdministrationServiceService s_adm = new AdministrationServiceServiceLocator("localhost",8080, "/services/AdministrationService", false); // adjust host and port number
AdministrationServiceSoapBindingStub adminService = (AdministrationServiceSoapBindingStub) s_adm.getAdministrationService();
AdministrationServiceRequest rsr = new AdministrationServiceRequest();
rsr.setLoginId("admin@yellowfin.com.au"); // provide your Yellowfin webservices admin account
rsr.setPassword("test"); // change to be the password of the account above
rsr.setOrgId(1);
rsr.setFunction("VALIDATEUSER");
AdministrationPerson ap = new AdministrationPerson();
ap.setUserId("john.smith@yellowfin.com.au");
ap.setPassword("test");
rsr.setPerson(ap);
rsr.setOrgRef("org1");
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
if ("SUCCESS".equals(rs.getStatusCode()) ) {
out.write("User is authenticated");
} else {
out.write("Failure");
out.write(" Code: " + rs.getErrorCode() );
}
%>
|
Anchor | ||||
---|---|---|---|---|
|
Expand | ||
---|---|---|
| ||
This call validates a user's password. If the password is expired, the call will return SUCCESS as the StatusCode, otherwise it will return FAILURE. It accepts AdministrationPerson as a parameter where you can provide user Id (email address or Id depending on the Logon ID method) and password to validate. Keep in mind that for a freshly created users who have not logged into Yellowfin yet, the call retrieves SUCCESS meaning that their password is expired. This happens because for every new user, Yellowfin requires to reset the password at the first logon.
|
Manipulating User Information
...