Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
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
languagepy
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:')

...


params = {

...


'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
languagepy
def test_3_verifySafeID(self):

...


otp=raw_input('Please enter you SafeIDotp:')

...


params = {

...


'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
languagepy
def test_4_sendOTP(self):

...


username=raw_input('Please enter your login name:')

...


params = {

...


'user':{'loginName':username, 'domain.name':domainname},

...


'options':{'channel':'SMTP'}

...


}

...


r=self.auth.execute("auth/sendOTP",

...

 params)


...

]]></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
languagepy
def test_5_verifyODP(self):

...


username=raw_input('Please enter your login name:')

...


otp=raw_input('Please enter you otp:')

...


params = {

...


'user':{'loginName':username, 'domain.name':domainname},

...


'credential':{'method':'OTPoD', 'otp':otp}

...


}

...


r=self.auth.execute("auth/verify",

...

 params)


The complete Python application is in the file "TestAPI.py"