AuthAuthorizationUser

Authenticates the current user and returns information about the user's company and the list of privileges enabled for the user's role.

Usage

You use the AuthAuthorizationUser method to authenticate the current user and return information relevant to the user.

There are no input argument, the method simply authenticates the current user name and password, and returns the information for the authenticated user.

The optional SOAP header parameter <AuthenticateOnly> is intended for use only with the AuthAuthorizationUser method:

  • Setting the <AuthenticateOnly> parameter to true and sending a subsequent request with security credentials results in the previous session being closed (that is, a logoff is performed), and a new session is created with the supplied credentials.

  • If the SOAP header parameter <SessionKeepAlive> is set to true, and a subsequent request does not contain security credentials, the previous session remains open and the request will be considered authenticated.

Note: If both <AuthenticateOnly> and <SessionKeepAlive> are set to true, <AuthenticateOnly> takes precedence.

Arguments

The following table describes the arguments taken by the AuthAuthorizationUser method.

Table Arguments Taken by the AuthAuthorizationUser Method

Name Description Required Default I/O

AuthenticatedUser

Information about the authenticated user.

Not applicable

Not applicable

Output

Return Value of the Call

The following information is returned:

  • UserId. The user ID of the authenticated user.

  • TenantId. The tenant for the authenticated user (SYS_TENANT_ID).

  • ListofPrivileges. The set of privileges that have been enabled for the user's role.

  • OrganizationName. The company name for the user.

  • Location. The location of the company.

  • RoleId. The role ID for the user’s role.

  • Role. The user’s role.

Sample SOAP Request - AuthAuthorizationUser

The following SOAP request invokes AuthAuthorizationUser. No arguments are required.

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/
XMLSchema-instance" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-
secext-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Header>
      <wsse:Security>
         <wsse:UsernameToken>
            <wsse:Username>%%%USERNAME%%%</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">%%%PASSWORD%%%</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soap:Header>
   <soap:Body>
      <AuthWS_AuthAuthorizationUser_Input xmlns="urn:crmondemand/ws/auth/" />
   </soap:Body>
</soap:Envelope>

Sample SOAP Response

The following illustrates the SOAP response (most of the <Privilege> elements are omitted as indicated by the ellipses (...)):

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <SOAP-ENV:Body>
      <ns:AuthWS_AuthAuthorizationUser_Output xmlns:ns="urn:crmondemand/ws/auth/">
         <AuthenticatedUser xmlns="urn:/crmondemand/xml/auth">
            <User>
               <UserId>1-CWTEQ</UserId>
               <TenantId>1-CWJ8T</TenantId>
               <OrganizationName>Farley 75</OrganizationName>
               <Location>Toronto</Location>
               <RoleId>1-CWJU5</RoleId>
               <Role>Vertical Admin</Role>
               <ListOfPrivileges>
                  <Privilege>
                     <PrivilegeName>FULL_ACCESS_ANALYTICS</PrivilegeName>YTICS</PrivilegeName>
                  </Privilege>
...
...
               </ListOfPrivileges>
            </User>
         </AuthenticatedUser>
      </ns:AuthWS_AuthAuthorizationUser_Output>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>