You are here: Discussion Register  |  Login
 
Discussion Forums
 
ForumForumGateway Web Ser...Gateway Web Ser...Other Web Servi...Other Web Servi...How can I tell if a user is authorized to access a customer?How can I tell if a user is authorized to access a customer?
Disabled 
Previous
 
Next Next
New Post
 6/25/2009 10:43 PM
 
 Modified By Kevin Lenahan  on 6/27/2009 12:01:32 AM

Before accessing a customer’s information, you may want to check to see if a user is authorized to access the customer. All gateway methods check to ensure the supplied username has the necessary access with attempting to access data. Based on the business case a separate check before making a series of calls could be beneficial.  

Here is an example of how you check a user’s authorization for a customer:
 
/* Get a reference to the web service */
using (GatewaySample.net.clearstar.gateway.user.User gwService = new GatewaySample.net.clearstar.gateway.user.User())
{
 
/* Check user authorization for a customer. */
XmlNode nodeUser = gwUser.AuthorizeUser("myUserName", "myPassword", myBOID, “LoginNameToCheck”, “LoginPassword”,"myCustID");
 
}
 
XML Response:
 
<AuthorizeUser xmlns="">
<ErrorStatus>
<Code></Code>
<Type></Type>
<Message></Message>
</ErrorStatus>
<User>
<sFirstName></sFirstName>
<sLastName></sLastName>
<bAuthorized></bAuthorized>
</User>
</AuthorizeUser>

 

Additional information is provided in the documentation and more example code is provided in the Gateway Sample application.

Disabled 
Previous
 
Next Next
ForumForumGateway Web Ser...Gateway Web Ser...Other Web Servi...Other Web Servi...How can I tell if a user is authorized to access a customer?How can I tell if a user is authorized to access a customer?

 

Privacy Statement  |  Terms Of Use
Copyright 2009 by ClearStar.net