# Security enabled, exception.NotAuthenticated: (80L, 'Failed to connect', 'src/main/aerospike/as\_cluster.c', 254, False)

**URL:** https://discuss.aerospike.com/t/security-enabled-exception-notauthenticated-80l-failed-to-connect-src-main-aerospike-as-cluster-c-254-false/6813
**Category:** General Discussion
**Created:** [November 11, 2019, 9:17pm UTC](https://discuss.aerospike.com/t/security-enabled-exception-notauthenticated-80l-failed-to-connect-src-main-aerospike-as-cluster-c-254-false/6813 "2019-11-11T21:17:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Mich\_Talebzadeh](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/mich_talebzadeh/32/1141_2.png) [@Mich\_Talebzadeh](https://discuss.aerospike.com/u/Mich_Talebzadeh)
#### Post date: [November 11, 2019, 9:17pm UTC](https://discuss.aerospike.com/t/security-enabled-exception-notauthenticated-80l-failed-to-connect-src-main-aerospike-as-cluster-c-254-false/6813/1 "2019-11-11T21:17:16Z")

</div>

Hi running Aerospike enterprise edition, using python client to connect to aerospike.

The code is as follows:

```auto
 
 # aerospike class variables
  dbHost = "rhes75"
  dbPort = 3000
  dbConnection = "mich"
  namespace = "test"
  dbPassword = "xxxxxxxx"
  dbSet = "oracletoaerospike2"

    # Check aerospike is accessible
    try:
      config = {
          'hosts': [(self.dbHost, self.dbPort)]
      }
      client = aerospike.client(config).connect([self.dbConnection, self.dbPassword])
    except ClientError as e:
      print("Error: {0} [{1}]".format(e.msg, e.code))
      sys.exit(1)
    else:
        print("Connection successful")
        client.close()
        sys.exit(0)

 I am getting this error

Traceback (most recent call last):
  File "./read_oracle_table.py", line 88, in <module>
    a.read_aerospike_set()
  File "./read_oracle_table.py", line 76, in read_aerospike_set
    client = aerospike.client(config).connect([self.dbConnection, self.dbPassword])
exception.NotAuthenticated: (80L, 'Failed to connect', 'src/main/aerospike/as_cluster.c', 254, False)

and the audit log shows

Nov 11 20:46:15 rhes75 asd: not authenticated | client: 50.140.197.220:39086 | authenticated user: <none> | action: info request | detail: <none>

```

So it cannot see the username. The documentation says:

```auto
connect([username, password])
Connect to the cluster. The optional username and password only apply when connecting to the Enterprise Edition of Aerospike.
Parameters
username (str) – a defined user with roles in the cluster. See admin_create_user().
password (str) – the password will be hashed by the client using bcrypt.
Raises
ClientError, for example when a connection cannot be established to a seed node (any single node in the cluster from which the client learns of the other nodes).

```

Thanks

---

<div class="post-metadata">

### Author: ![Mich\_Talebzadeh](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/mich_talebzadeh/32/1141_2.png) [@Mich\_Talebzadeh](https://discuss.aerospike.com/u/Mich_Talebzadeh)
#### Post date: [November 11, 2019, 10:21pm UTC](https://discuss.aerospike.com/t/security-enabled-exception-notauthenticated-80l-failed-to-connect-src-main-aerospike-as-cluster-c-254-false/6813/2 "2019-11-11T22:21:11Z")

</div>

With a clarification from Ronan Botzer , this is resolved 🙂

The issue was that I interpreted the as part of the syntax

```auto
connect([username, password])

```

So the correct code is:

```auto
client = aerospike.client(config).connect(self.dbConnection, self.dbPassword)

```

HTH
