jack sparrow
jack sparrow

Reputation: 35

User Token Type in OPC UA

What is the User Token Type in OPC UA? Why is this important, how do I know the User Token Type from the server, and add this in client to connect to the server?

Upvotes: 3

Views: 3101

Answers (2)

jayanthvelu
jayanthvelu

Reputation: 71

I will answer your question in two parts.

Part 1:

What is the User Token Type in OPC UA? Why is this important?

Part 2:

How do I know the User Token Type from the server, and add this in client to connect to the server?

Part 1: This comes under the topic of user authentication, i.e. when a user is trying to connect from an OPC UA Client to an OPC UA Server, the OPC UA server needs to confirm the identity of the user before allowing the connection from the OPC UA client.

There are four ways in which user authentication is specified in OPC UA and ‘UserTokenType’ is an enumeration specified with the values 0, 1, 2 and 3 for those four ways:

Anonymous

  • Connect without any credentials – can be useful during developer test/debug sessions
  • Should not to be used for deployments in the field
  • UserIdentityToken used is ‘AnonymousIdentityToken’

UserName

  • Username and password
  • The password may be encrypted by the client depending on the UserTokenPolicy used
  • UserIdentityToken used is ‘UserNameIdentityToken’

Certificate

  • X.509 v3 certificate
  • The certificate can include a signature depending on the UserTokenPolicy used
  • UserIdentityToken used is ‘X509IdentityToken’

IssuedToken

  • Text or binary token issued by an external authorization service
  • The token data may be encrypted by the client depending on the UserTokenPolicy used
  • UserIdentityToken used is ‘IssuedIdentityToken’

Part 2: This wireshark trace contains the sequence of GetEndpointsRequest/GetEndpointsResponse between an OPC UA client and an OPC UA server. As you can see, the getEndpointResponse packet provides information on userTokens supported by the server. Specifically in this image, you can see that 'Anonymous' and 'UserName' are supported in a sample implementation.

enter image description here

Here you can see a list of some open source OPC UA stacks that also provide related sample application code that you can try out:

If you are looking for more hands-on information, you can check out these resources

Upvotes: 7

Kevin Herron
Kevin Herron

Reputation: 7005

UserTokenType enumerates various authentication mechanisms (anonymous, username/password, x509, etc...)

Each endpoint you get from a server contains an array of UserTokenPolicy describing an authentication mechanism supported by that endpoint.

Upvotes: 0

Related Questions