...
Code Block |
---|
|
def test_1_hello(self):
r=self.auth.execute("auth/hello", {})
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e9129c09-948c-45d8-be42-50c5ca2ba70c"><ac:plain-text-body>
<![CDATA[ self.assertEqual(r['error'], 0)
]]></ac:plain-text-body></ac:structured-macro>
|
Anchor |
---|
| _Toc341972304 |
---|
| _Toc341972304 |
---|
|
Static Password Authentication
The authentication method for verifying Static Password is "SPASS"
Code Block |
---|
|
def test_2_staticpass(self): |
...
#logon with 'static password' credential |
...
username=raw_input('Please enter your login name:') |
...
password=raw_input('Please enter your AD password:') |
...
...
'user':{'loginName':username, 'domain.name':domainname}, |
...
'credential':{'method':'SPASS', 'password':password} |
...
...
r=self.auth.execute("auth/verify", params) |
...
]]></ac:plain-text-body></ac:structured-macro>
Anchor |
---|
| _Toc341972305 |
---|
| _Toc341972305 |
---|
|
One-Time Password Authentication
The authentication method for verifying Static Password is "OTP"
Code Block |
---|
|
def test_3_verifySafeID(self): |
...
otp=raw_input('Please enter you SafeIDotp:') |
...
...
'user':{'loginName':username, 'domain.name':domainname}, |
...
'credential':{'method':'OTP', 'otp':otp} |
...
...
r=self.auth.execute("auth/verify", params) |
...
]]></ac:plain-text-body></ac:structured-macro>
Anchor |
---|
| _Toc341972306 |
---|
| _Toc341972306 |
---|
|
Deliver On-Demand Password
To deliver an on-demand password to a user via email message (SMTP)
Code Block |
---|
|
def test_4_sendOTP(self): |
...
username=raw_input('Please enter your login name:') |
...
...
'user':{'loginName':username, 'domain.name':domainname}, |
...
'options':{'channel':'SMTP'} |
...
...
r=self.auth.execute("auth/sendOTP", |
...
...
]]></ac:plain-text-body></ac:structured-macro>
Anchor |
---|
| _Toc341972307 |
---|
| _Toc341972307 |
---|
|
On-Demand Password Authentication
The authentication method for verifying On-Demand Password is "OTPoD"
Code Block |
---|
|
def test_5_verifyODP(self): |
...
username=raw_input('Please enter your login name:') |
...
otp=raw_input('Please enter you otp:') |
...
...
'user':{'loginName':username, 'domain.name':domainname}, |
...
'credential':{'method':'OTPoD', 'otp':otp} |
...
...
r=self.auth.execute("auth/verify", |
...
The complete Python application is in the file "TestAPI.py"