<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Creating  internal user' Python script in Network Access Control</title>
    <link>https://community.cisco.com/t5/network-access-control/creating-internal-user-python-script/m-p/4406530#M567457</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;i am trying to&amp;nbsp; create&amp;nbsp; internal user python script&amp;nbsp; for&amp;nbsp; ISE but&amp;nbsp; i can encouter an error while excute my code . Below is my my code and i have already enable&amp;nbsp; TLS 1.0 Aand TLS 1.1 . Thsi is my cmmand&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;python Internal_user.py 192.168.31.16 ersadmin oFlPRbe1 ab200 Kwame Brown Password1 kwame.brown@gh.co.uk 2021-01-30&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#!/usr/bin/env python&lt;/P&gt;&lt;P&gt;import http.client&lt;BR /&gt;import base64&lt;BR /&gt;import ssl&lt;BR /&gt;import sys&lt;BR /&gt;import requests&lt;BR /&gt;import urllib3&lt;BR /&gt;urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)&lt;/P&gt;&lt;P&gt;#parameters&lt;BR /&gt;name = sys.argv[4] # "ab200"&lt;BR /&gt;first = sys.argv[5] # "Kwame"&lt;BR /&gt;last = sys.argv[6] # "Brown"&lt;BR /&gt;passwd = sys.argv[7] # "Password1"&lt;BR /&gt;email = sys.argv[8] # "kwame.brown@gh.co.uk"&lt;BR /&gt;expiry_date = sys.argv[9] # "2021-12-30"&lt;/P&gt;&lt;P&gt;# host and authentication credentials&lt;BR /&gt;host = sys.argv[1] # "192.168.31.16"&lt;BR /&gt;user = sys.argv[2] # "ersadmin"&lt;BR /&gt;password = sys.argv[3] # "oFlPRbe1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;conn = http.client.HTTPSConnection("{}:9060".format(host), context=ssl.SSLContext(ssl.PROTOCOL_TLSv1))&lt;/P&gt;&lt;P&gt;creds = str.encode(':'.join((user, password)))&lt;BR /&gt;encodedAuth = bytes.decode(base64.b64encode(creds))&lt;/P&gt;&lt;P&gt;req_body_json = """ {{&lt;BR /&gt;"InternalUser" : {{&lt;BR /&gt;"name" : "{}",&lt;BR /&gt;"enabled" : true,&lt;BR /&gt;"email" : "{}",&lt;BR /&gt;"password" : "{}",&lt;BR /&gt;"firstName" : "{}",&lt;BR /&gt;"lastName" : "{}",&lt;BR /&gt;"changePassword" : true,&lt;BR /&gt;"expiryDateEnabled" : true,&lt;BR /&gt;"expiryDate" : "{}",&lt;BR /&gt;"enablePassword" : "{}",&lt;BR /&gt;"customAttributes" : {{&lt;BR /&gt;}},&lt;BR /&gt;"passwordIDStore" : "Internal Users"&lt;BR /&gt;}}&lt;BR /&gt;}}&lt;BR /&gt;""".format(name,email,passwd,first,last,expiry_date,passwd)&lt;/P&gt;&lt;P&gt;headers = {&lt;BR /&gt;'accept': "application/json",&lt;BR /&gt;'content-type': "application/json",&lt;BR /&gt;'authorization': " ".join(("Basic",encodedAuth)),&lt;BR /&gt;'cache-control': "no-cache",&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;conn.request("POST", "/ers/config/internaluser/", headers=headers, body=req_body_json)&lt;/P&gt;&lt;P&gt;res = conn.getresponse()&lt;BR /&gt;data = res.read()&lt;/P&gt;&lt;P&gt;print("Status: {}".format(res.status))&lt;BR /&gt;print("Header:\n{}".format(res.headers))&lt;BR /&gt;print("Body:\n{}".format(data.decode("utf-8")))&lt;BR /&gt;print('-'*80)&lt;BR /&gt;print(req_body_json)&lt;BR /&gt;print('-'*80)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is&amp;nbsp; my error&lt;/P&gt;&lt;P&gt;ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1123)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestion are welcomed .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 May 2021 11:03:05 GMT</pubDate>
    <dc:creator>RichardAcolatse8417</dc:creator>
    <dc:date>2021-05-21T11:03:05Z</dc:date>
    <item>
      <title>Creating  internal user' Python script</title>
      <link>https://community.cisco.com/t5/network-access-control/creating-internal-user-python-script/m-p/4406530#M567457</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;i am trying to&amp;nbsp; create&amp;nbsp; internal user python script&amp;nbsp; for&amp;nbsp; ISE but&amp;nbsp; i can encouter an error while excute my code . Below is my my code and i have already enable&amp;nbsp; TLS 1.0 Aand TLS 1.1 . Thsi is my cmmand&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;python Internal_user.py 192.168.31.16 ersadmin oFlPRbe1 ab200 Kwame Brown Password1 kwame.brown@gh.co.uk 2021-01-30&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#!/usr/bin/env python&lt;/P&gt;&lt;P&gt;import http.client&lt;BR /&gt;import base64&lt;BR /&gt;import ssl&lt;BR /&gt;import sys&lt;BR /&gt;import requests&lt;BR /&gt;import urllib3&lt;BR /&gt;urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)&lt;/P&gt;&lt;P&gt;#parameters&lt;BR /&gt;name = sys.argv[4] # "ab200"&lt;BR /&gt;first = sys.argv[5] # "Kwame"&lt;BR /&gt;last = sys.argv[6] # "Brown"&lt;BR /&gt;passwd = sys.argv[7] # "Password1"&lt;BR /&gt;email = sys.argv[8] # "kwame.brown@gh.co.uk"&lt;BR /&gt;expiry_date = sys.argv[9] # "2021-12-30"&lt;/P&gt;&lt;P&gt;# host and authentication credentials&lt;BR /&gt;host = sys.argv[1] # "192.168.31.16"&lt;BR /&gt;user = sys.argv[2] # "ersadmin"&lt;BR /&gt;password = sys.argv[3] # "oFlPRbe1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;conn = http.client.HTTPSConnection("{}:9060".format(host), context=ssl.SSLContext(ssl.PROTOCOL_TLSv1))&lt;/P&gt;&lt;P&gt;creds = str.encode(':'.join((user, password)))&lt;BR /&gt;encodedAuth = bytes.decode(base64.b64encode(creds))&lt;/P&gt;&lt;P&gt;req_body_json = """ {{&lt;BR /&gt;"InternalUser" : {{&lt;BR /&gt;"name" : "{}",&lt;BR /&gt;"enabled" : true,&lt;BR /&gt;"email" : "{}",&lt;BR /&gt;"password" : "{}",&lt;BR /&gt;"firstName" : "{}",&lt;BR /&gt;"lastName" : "{}",&lt;BR /&gt;"changePassword" : true,&lt;BR /&gt;"expiryDateEnabled" : true,&lt;BR /&gt;"expiryDate" : "{}",&lt;BR /&gt;"enablePassword" : "{}",&lt;BR /&gt;"customAttributes" : {{&lt;BR /&gt;}},&lt;BR /&gt;"passwordIDStore" : "Internal Users"&lt;BR /&gt;}}&lt;BR /&gt;}}&lt;BR /&gt;""".format(name,email,passwd,first,last,expiry_date,passwd)&lt;/P&gt;&lt;P&gt;headers = {&lt;BR /&gt;'accept': "application/json",&lt;BR /&gt;'content-type': "application/json",&lt;BR /&gt;'authorization': " ".join(("Basic",encodedAuth)),&lt;BR /&gt;'cache-control': "no-cache",&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;conn.request("POST", "/ers/config/internaluser/", headers=headers, body=req_body_json)&lt;/P&gt;&lt;P&gt;res = conn.getresponse()&lt;BR /&gt;data = res.read()&lt;/P&gt;&lt;P&gt;print("Status: {}".format(res.status))&lt;BR /&gt;print("Header:\n{}".format(res.headers))&lt;BR /&gt;print("Body:\n{}".format(data.decode("utf-8")))&lt;BR /&gt;print('-'*80)&lt;BR /&gt;print(req_body_json)&lt;BR /&gt;print('-'*80)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is&amp;nbsp; my error&lt;/P&gt;&lt;P&gt;ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1123)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestion are welcomed .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 11:03:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/creating-internal-user-python-script/m-p/4406530#M567457</guid>
      <dc:creator>RichardAcolatse8417</dc:creator>
      <dc:date>2021-05-21T11:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Creating  internal user' Python script</title>
      <link>https://community.cisco.com/t5/network-access-control/creating-internal-user-python-script/m-p/4413732#M567725</link>
      <description>&lt;P&gt;See my response to &lt;A href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1192302" target="_blank"&gt;@Richie20&lt;/A&gt; in the post &lt;A href="https://community.cisco.com/t5/network-access-control/creating-internal-users-by-python-and-argparse/m-p/4407676" target="_self"&gt;&lt;STRONG&gt;Creating Internal users by python and argparse&lt;/STRONG&gt;&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;It includes a templating example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Jun 2021 23:29:30 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/creating-internal-user-python-script/m-p/4413732#M567725</guid>
      <dc:creator>thomas</dc:creator>
      <dc:date>2021-06-06T23:29:30Z</dc:date>
    </item>
  </channel>
</rss>

