Invoke the /atg/userprofiling/ProfileServices.loginUser method to log in to the Legacy REST Web Services server as an external user. Supply your username and password as functional parameters with the HTTP POST request. Use the positional parameter name arg1 for the username and arg2 for the password.

See information about functional parameters and invoking methods in Functional Parameters for Legacy REST and Invoking Legacy REST Component Methods.

Success and Failure Responses for External User Log In

If your attempt to log in is successful, the Legacy REST Web Services server will return the identifier of the user account in an HTTP response with status code 200 OK. For example, <atgResponse>120001</atgResponse>.

If your attempt to log in fails, the server will return a null value in an HTTP response with status code 200 OK. For example, <atgResponse/>.

Note: the server returns status code 200 OK in both conditions. Make sure you examine the response value to determine whether an attempt to log in succeeded.

Example of Logging in as an External User

The following example shows an HTTP request to open a Legacy REST Web Services session as an external user. The server returns a session identifier in the field labeled JSESSIONID.

curl -v -c cookies.txt -X POST \
-H "Content-Type: application/xml" \
-d "<parameters><arg1>MyUsername</arg1><arg2>MyPassword</arg2></parameters>" \
http://myserver:8280/rest/bean/atg/userprofiling/ProfileServices/loginUser

* About to connect() to myserver port 8280 (#0)
*   Trying 12.34.567.890... connected
* Connected to myserver (12.34.567.890) port 8280 (#0)
> POST /rest/bean/atg/userprofiling/ProfileServices/loginUser HTTP/1.1
> User-Agent: curl/7.21.1 (i386-pc-win32) libcurl/7.21.1 zlib/1.2.5
> Host: myserver:8280
> Accept: */*
> Content-Type: application/xml
> Content-Length: 71
>
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1
* Added cookie JSESSIONID="7978B952714AB08BEB006A348A25ADB0" for
* domain myserver, path /, expire 0
< Set-Cookie: JSESSIONID=7978B952714AB08BEB006A348A25ADB0; Path=/
< X-ATG-Version: version=
QVRHUGxhdGZvcm0vMTAuMCxDb21tZXJjZVJlZmVyZW5jZVN0b3JlLzEwLjAgWyBQbGF0Zm9y
bUxpY2Vuc2UvMCBCMkNMaWNlbnNlLzAgIF0=
* Added cookie DYN_USER_ID="120001" for domain myserver, path /, expire 1290872360
< Set-Cookie: DYN_USER_ID=120001; Expires=Sat, 27-Nov-2010 15:39:20 GMT; Path=/
* Added cookie DYN_USER_CONFIRM="bca3eb6c2cdeb0e4a625c7165a088e2e" for domain
myserver, path /, expire 1290872360
< Set-Cookie: DYN_USER_CONFIRM=bca3eb6c2cdeb0e4a625c7165a088e2e;
Expires=Sat, 27-Nov-2010 15:39:20 GMT; Path=/
< Content-Type: application/xml;charset=UTF-8
< Transfer-Encoding: chunked
< Date: Thu, 28 Oct 2010 15:39:20 GMT
<
<?xml version="1.0" encoding="UTF-8"?>

<atgResponse>120001</atgResponse>
* Connection #0 to host myserver left intact
* Closing connection #0
Specifying a Profile Realm

Include the pushRealm URL query parameter to specify a profile realm while you are logging in to the Legacy REST Web Services interface. Include the identifier of the profile realm as the value of the pushRealm parameter. See information about profile realms in the ATG Multisite Administration Guide. See information about the pushRealm parameter in the ATG Platform Programming Guide.

For example:

http://mydomain.com/rest/bean/atg/userprofiling/ProfileServices/loginUser?
pushRealm=myrealmid

Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices