Session

From ToxBank API Wiki
(Difference between revisions)
Jump to: navigation, search
m (Created page with "This is currently wrapper for OpenTox (OpenAM) login/logout = Login = {{REST Operations |REST_op_description=Login |REST_op_method=POST |REST_op_uri=/session |REST_op_params=us...")
 
(Logout)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This is currently wrapper for OpenTox (OpenAM) login/logout
+
{{REST_resource}}
  
= Login =
+
= OpenAM =
{{REST Operations
+
|REST_op_description=Login
+
|REST_op_method=POST
+
|REST_op_uri=/session
+
|REST_op_params=user name and password ,optionally scheme (default OpenAM) , OpenAM server URI (has default )
+
|REST_op_mime_input=application/x-www-form-urlencoded
+
|REST_op_result=the token in the html body , optional cookie
+
|REST_op_mime_output=text/plain
+
||REST_op_status=200,401,403,500
+
}}
+
  
= Logout =
+
Currently, login/logout is done by calling OpenAM [[OpenTox_API_1.2_A%26A]]
{{REST Operations
+
 
|REST_op_description=Logout
+
== Java library ==
|REST_op_method=DELETE
+
http://vedina.github.com/opentox-aa-cli/
|REST_op_uri=/session
+
 
|REST_op_params=header parameter subjectid
+
== Ruby library ==
|REST_op_mime_input=none
+
...
|REST_op_result=none
+
 
|REST_op_mime_output=text/plain
+
= Session REST interface =
|REST_op_status=200,401,403,500
+
 
}}
+
This could be a wrapper for the [[OpenTox_API_1.2_A%26A]] (OpenAM) login/logout.
 +
 
 +
== Login ==
 +
{{HasOperation |id=Session:Login}}
 +
 
 +
=== cURL example ===
 +
 
 +
$curl -X POST -d "user=myname" -d "pass=mypass" https://toxbank.net/services/session
 +
>HTTP/1.1 200 OK
 +
>Content-Language: en
 +
>Date: Fri, 16 Sep 2011 06:45:16 GMT
 +
>Set-Cookie: subjectid=AQIC5wM2LY4SfczdemotokenzuhvIfb6LJj5SOVppnOTw7M.*AAJTSQACMDE.*; Path=/
 +
>Set-Cookie: subjectid_secure=true; Path=/
 +
>Content-Type: text/plain;charset=UTF-8
 +
>Content-Length: 7241
 +
>AQIC5wM2LY4SfczdemotokenzuhvIfb6LJj5SOVppnOTw7M.*AAJTSQACMDE.*
 +
 
 +
== Logout ==
 +
{{HasOperation |id=Session:Logout}}
 +
 
 +
=== cURL example ===
 +
 
 +
$curl -X DELETE -H "subjectid:AQIC5wM2LY4SfczdemotokenzuhvIfb6LJj5SOVppnOTw7M.*AAJTSQACMDE.*" https://toxbank.net/services/session

Latest revision as of 12:50, 7 October 2011

Session


Contents

OpenAM

Currently, login/logout is done by calling OpenAM OpenTox_API_1.2_A&A

Java library

http://vedina.github.com/opentox-aa-cli/

Ruby library

...

Session REST interface

This could be a wrapper for the OpenTox_API_1.2_A&A (OpenAM) login/logout.

Login

Description Login
Resource Session
Method POST
URI /session
Parameters user name and password ,optionally scheme (default OpenAM) , OpenAM server URI (has default )
Header Parameters
Media Type (input) application/x-www-form-urlencoded
Results the token in the html body , optional cookie
Media Type (output) text/plain
Status code 200,401,403,500

Links: Page, Edit with form



cURL example

$curl -X POST -d "user=myname" -d "pass=mypass" https://toxbank.net/services/session
>HTTP/1.1 200 OK
>Content-Language: en
>Date: Fri, 16 Sep 2011 06:45:16 GMT
>Set-Cookie: subjectid=AQIC5wM2LY4SfczdemotokenzuhvIfb6LJj5SOVppnOTw7M.*AAJTSQACMDE.*; Path=/
>Set-Cookie: subjectid_secure=true; Path=/
>Content-Type: text/plain;charset=UTF-8
>Content-Length: 7241
>AQIC5wM2LY4SfczdemotokenzuhvIfb6LJj5SOVppnOTw7M.*AAJTSQACMDE.*

Logout

Description Logout
Resource Session
Method DELETE
URI /session
Parameters none
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input) none
Results none
Media Type (output) text/plain
Status code 200,401,403,500

Links: Page, Edit with form



cURL example

$curl -X DELETE -H "subjectid:AQIC5wM2LY4SfczdemotokenzuhvIfb6LJj5SOVppnOTw7M.*AAJTSQACMDE.*" https://toxbank.net/services/session
Personal tools