IdentityToken#

class IdentityToken#

Bases: object

Credentials used to authenticate one OPC UA session.

Create credentials with anonymous(), user_name(), or x509().

Examples

>>> identity = IdentityToken.user_name("operator", "password")
>>> client = OpcUaClient.connect("opc.tcp://localhost:4840", identity=identity)

Methods

anonymous

Create an anonymous identity.

user_name

Create an identity from a username and password.

x509

Read a user certificate and private key from filesystem paths.

static anonymous()#

Create an anonymous identity.

Returns:

IdentityToken – Anonymous session credentials.

static user_name(username, password)#

Create an identity from a username and password.

Parameters:
  • username (str)

    User name, including an empty name if the server permits it.

  • password (str)

    Password, including an empty password if the server permits it.

Returns:

IdentityToken – Username session credentials.

static x509(certificate_path, private_key_path)#

Read a user certificate and private key from filesystem paths.

These credentials authenticate the user, separately from the application’s certificate configured on the client.

Parameters:
Returns:

IdentityToken – Certificate session credentials.