login

Use API keys to get authenticated.

Description

Use API keys to authenticate your access to ALM.

URL

/qcbin/rest/oauth2/login

Remarks

Obtain a Client ID and API Key Secret from your ALM customer administrator and enter them in a POST message.

HTTP Methods

GET: N/A

PUT: N/A

DELETE: N/A

POST: Authenticates the user.

Media Type
GET
PUT
DELETE
POST
application/xml
-
-
-
-
application/json
-
-
-
check

Returns

On a successful POST, the login resource returns LWSSO_COOKIE_KEY, ALM_USER, QCSession, and XSRF_TOKEN in Set-Cookie. Provide them in the header of all subsequent API messages.

The request also opens a session. If you specify the client type in the request header, the returned QCSession includes a suffix encoded in Base64 format (for example, QCSession-d2ViYWRtaW4X). Such a QCSession cannot be used to call APIs that do not have the client type specified in the request header.

One of the HTTP Return Codes.

CodeCause
401Incorrect secret
403Client ID not listed as active API Key in ALM
500Internal server error

Example

Copy code
**** Request ****
POST /qcbin/rest/oauth2/login
Content-Type: application/json

{"clientId":"oauth2-wySfthjk8uGi4Kdj4DFH@MyCompany.com", "secret":"etUgyeKdMvftoO8dI3CW"}

**** Response ****
HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
Expires: Thu, 01 Jan 1970 00:00:00 GMT
X-XSS-protection: 1; mode=block
Content-Length: 0
Proxy-Connection: Keep-Alive
Connection: Keep-Alive
Set-Cookie: JSESSIONID=node0ogi55m0mqjaw1d8g9luuilek08.node0; Path=/qcbin; HttpOnly
Set-Cookie: LWSSO_COOKIE_KEY=s8EFty2R4BhawGRbaJD9Dg-J9Q_oeRx7z9c7XSI1kGsrQsrG64c9HT9MU-
ETbdW45W8XSvVJkeJLPqy7ZrwvNoYVOnN_ew0qMf9VhiHOUbYGfkQ0ohLQgDCpGP8D9kSW8t0lZx0tpmIsKPaORtIBoGyh6XfRcmTDH-l-
u4x89QNCfX9jzvSGLq7flHXJJWwM8JBPsbhdYtp6oanWcBLLfobGBsMG8tlwD2vi7xjVIPH1zlW7xsef_4c7CcfnzxYH9nMOJitl1KGNeECLBI106g..; 
Path=/qcbin; HttpOnly
Set-Cookie: QCSession=MjU0NTM7Uzc4NHJjejh6UG1ibHNVdFo3Z21OdyoqO1JFU1QgY2xpZW50OyA7IDthcGlrZXktbW5qcGdlZmZhb2JlcW1xaW10bHA.; 
Path=/qcbin; HttpOnly
Set-Cookie: ALM_USER=4cf6829aa93728e8f3c97df913fb1bfa95fe5810e2933a05943f8312a98d9cf2; Path=/qcbin
Set-Cookie: XSRF-TOKEN=b6aef0f00d9f7e518f89f46940e49ec78143356f4dccf584ee51cddf54436e97; Path=/qcbin

Note:  

See Also

Authenticate