ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » WorkFlow Authenication Exit

Post new topic  Reply to topic
 WorkFlow Authenication Exit « View previous topic :: View next topic » 
Author Message
amittalekar
PostPosted: Thu Apr 04, 2002 12:05 pm    Post subject: Reply with quote

Disciple

Joined: 03 Apr 2002
Posts: 166
Location: VA, USA

Hi,

I have done all the setup for authentication exit.
Can anybody tell me what is the correct way to pass user crendentials to logon3 API.
My username is "AMIT", and password is "amit".
I am using following code to login the workflow

ExecutionService service = null;
String s1="AMIT,amit";
byte[] b1 = new byte[s1.length()];
s1.getBytes(0, s1.length(), b1, 0);
service.logon3(b1);

Is this the right way?
Waiting fro resonse

Thanks & Regards
Amit



Back to top
View user's profile Send private message Yahoo Messenger
JImmy
PostPosted: Mon Apr 08, 2002 9:08 pm    Post subject: Reply with quote

Acolyte

Joined: 23 Feb 2002
Posts: 59
Location: Shanghai, China

There is a authentication exit sample code shipped with the MQWF product and the credential bytes to be passed to logon3 should be in format defined in the authentication exit. I tried the sample and it works fine.
Good luck.
Back to top
View user's profile Send private message Visit poster's website AIM Address
amittalekar
PostPosted: Wed Apr 10, 2002 4:51 pm    Post subject: Reply with quote

Disciple

Joined: 03 Apr 2002
Posts: 166
Location: VA, USA

Hi

I am using MQ WorkFlow version 3.3.0. We applied service pack 3.
I couldn't find out sample code for authentication exit in MQWF 3.3.0 CD.
I have already gone through Installable & Programmable guide .

Configuration details are as follows :-
WorkFlow server and java corba agent both running on the same server.
Authentication client is running from the remote machine.

I am using logon3 API for this perpose.

Steps followed:-
1) put the authentication class in com.ibm.workflow.java.exit package
2) put this package in the path visible to WorkFlow server.
3) set RTAuthenticationExitTypeServer server variable to JAVA.
4) restarted the WorkFlow server.
5) run authentication client.

I am always getting "Not Authorized" error.
My authentication class is never called by server.I varified this by creating
traces using "fmczchk -dc trc:99" command.

Can please anybody help me to solve this problem.
Waiting for ur valuable input.

Thanks & Regards
Amit
Back to top
View user's profile Send private message Yahoo Messenger
JImmy
PostPosted: Sat Apr 13, 2002 7:27 am    Post subject: Reply with quote

Acolyte

Joined: 23 Feb 2002
Posts: 59
Location: Shanghai, China

Amit,
The exception "Not Authorized" indicates that neither you define the authentication exit nor you define correct entry in the authentication exit. So you must have method authenticate() in your Authentication.java file. I performed the following steps and the sample works fine:
1. Implement the authentication class, the following code is extracted from Authentication.java file, using com.ibm.workflow.java.exit as the package name in the file. I just use a very sample method to do authentication, which consider that the format of credential string like "userid:password". And no user mapping and no password checking.
----------------------------------------------------------------------------
public static int authenticate(Hashtable exitParam)
{
String FMC_NEXT_PHASE = "NextPhase";
String FMC_LOGON_ACCEPTED = "LogonAccepted";
String FMC_LOGON_DENIED = "LogonDenied";
String FMC_ERROR = "Error";
int FMC_EXIT_OK = 0;
int FMC_EXIT_RECOVERABLE_ERROR = 1;
int FMC_EXIT_NONRECOVERABLE_ERROR = 2;

// input parameters
Integer exitVersion = (Integer) exitParam.get("exitParameterListVersion");
Integer version = (Integer) exitParam.get("version");
Integer release = (Integer) exitParam.get("release");
Integer modLevel = (Integer) exitParam.get("modlevel");
byte[] credentials = (byte[]) exitParam.get("userCredentials");
String correlID = (String) exitParam.get("exitCorrelID");
Integer phase = (Integer) exitParam.get("phaseNumber");
String result = (String) exitParam.get("exitResult");
Integer reason = (Integer) exitParam.get("reasonCode");
String userName = (String) exitParam.get("userName");
String mqwfUserID = (String) exitParam.get("mqwfUserID");

// request processing
result = FMC_NEXT_PHASE; // FMC_LOGON_ACCEPTED, FMC_LOGON_DENIED, FMC_ERROR
reason = new Integer(0);

try {
String cred = new String(credentials);
int index = cred.indexOf(':');
if (-1 != index) {
userName = cred.substring(0, index);
String password = cred.substring(index+1, cred.length());
System.out.println("User ID: " + userName + " password: " + password);
mqwfUserID = userName;
result = FMC_LOGON_ACCEPTED;
} else {
result = FMC_LOGON_DENIED;
}
} catch (Exception e) {
System.out.println("Error:n" + e.toString());
result = FMC_ERROR;
}

int rc = 0; // FMC_EXIT_OK (-> 0), FMC_EXIT_RECOVERABLE_ERROR (-> 1), FMC_EXIT_NONRECOVERABLE_ERROR (-> 2)

// output parameters
exitParam.put("exitCorrelID", correlID);
exitParam.put("exitResult", result);
exitParam.put("reasonCode", reason);
exitParam.put("userName", userName);
exitParam.put("mqwfUserID", mqwfUserID);
exitParam.put("userCredentials", credentials);

return rc;
}
------------------------------------------------------------------------------

2. Package the class file to a jar file such as fmcauth.jar, ensure you package the proper folder in the jar file, that is, if you open the jar file, you should find file in such folder: com/ibm/workflow/java/exit/Authentication.class. And then put the jar file to system CLASSPATH environment variable. Please notice that maybe there are two CLASSPATH environment variables defined in Windows, one for all users and one for current user, if so, I suggest remove the CLASSPATH variable for all users and modify the CLASSPATH for current user to include the jar file you just created.

3. Issue command "fmczchk -c inst:m,RTAuthenticationExitTypeServer,JAVA -y FMC" to notify MQWF administration server to use java authentication mechanism.

4. Restart MQWF administration server, if neccessary, restart the computer instead.

5. Write the client code like the following
-------------------------------------------------------------------------------
String userid = "ADMIN";
String password = "password";

Agent agent = new Agent();
agent.setLocator(Agent.LOC_LOCATOR);
agent.setName("MQWFAGENT");
ExecutionService service = agent.locate("", "");

String credentials = userid + ":" + password;
byte[] cred = credentials.getBytes();
service.logon3(cred);
-------------------------------------------------------------------------------

And I am using MQWF 3.3.1 (MQSeries 5.2.1), Window 2000 Advanced Server.


GOOD LUCK!
Back to top
View user's profile Send private message Visit poster's website AIM Address
amittalekar
PostPosted: Mon Apr 15, 2002 1:15 pm    Post subject: Reply with quote

Disciple

Joined: 03 Apr 2002
Posts: 166
Location: VA, USA

Hey Jimmy,

Thanks a lot.

Regards,
Amit
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » WorkFlow Authenication Exit
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.