Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 69 lines (56 sloc) 2.515 kB
9dc328f @cstar [TECH-1154] OAuth support
cstar authored
1 <?xml version="1.0"?>
2 <!DOCTYPE tsung SYSTEM "@prefix@/share/@PACKAGE_NAME@/@DTD@">
3 <tsung loglevel="debug" dumptraffic="true" version="1.0">
4
5 <clients>
6 <client host="localhost" weight="1" maxusers="1000" use_controller_vm="true"/>
7 </clients>
8
9 <servers>
10 <server host="127.0.0.1" port="8000" type="tcp"></server>
11 </servers>
12
13 <load>
14 <arrivalphase phase="1" duration="2" unit="second">
15 <users interarrival="1" unit="second"></users>
16 </arrivalphase>
17 </load>
18
19 <sessions>
20 <session name="http_test_1" probability="100" type="ts_http">
21 <!--1. fetching token from SSO
22 using tsung XPath dynvars, the access_token and secret are stored for future use.
23 Please note the <oauth/> element with the consumer information.
24 By default requests are signed with "HMAC-SHA1" so it's not necessary here.
25 -->
26 <request>
27 <dyn_variable name="access_token" xpath="/tokenCreationResponse/tokenInfo/token/text()"/>
28 <dyn_variable name="access_token_secret" xpath="/tokenCreationResponse/tokenInfo/tokenSecret/text()" />
29 <http url="/token" method="POST" version="1.1" contents="rien">
30 <oauth consumer_key="key" consumer_secret="secret" method="HMAC-SHA1"/>
31 </http>
32 </request>
33
34 <!--2. access to protected resources
35 Using the variables set from the SSO, we are now able to access the protected resource
36 -->
37 <request subst="true">
38 <http url="/echo" method="GET" version="1.1">
39 <oauth consumer_key="key" consumer_secret="secret" access_token="%%_access_token%%" access_token_secret="%%_access_token_secret%%"/>
40 </http>
41 </request>
42
43 <!--3. refreshing token
44 refreshing the token work mostly as in step 1.
45 Values are overridden-->
46
47 <request subst="true">
48 <dyn_variable name="access_token" xpath="/tokenCreationResponse/tokenInfo/token/text()"/>
49 <dyn_variable name="access_token_secret" xpath="/tokenCreationResponse/tokenInfo/tokenSecret/text()" />
50 <http url="/token/%%_access_token%%" method="PUT" version="1.1">
51 <oauth consumer_key="key" consumer_secret="secret"/>
52 </http>
53 </request>
54
55 <!--4. access to protected resources
56 See step 2.-->
57
58 <request subst="true">
59 <http url="/echo" method="GET" version="1.1">
60 <oauth consumer_key="key" consumer_secret="secret" access_token="%%access_token_secret%%" access_token_secret="%%access_token_secret%%"/>
61 </http>
62 </request>
63 </session>
64 </sessions>
65
66 </tsung>
67
68
Something went wrong with that request. Please try again.