The UserNameIdentityToken is used to pass simple username/password credentials to the Server.
This token shall be encrypted by the Client if required by the SecurityPolicy of the UserTokenPolicy. The Server should specify a SecurityPolicy for the UserTokenPolicy if the SecureChannel has a SecurityPolicy of None and no transport layer encryption is available. If None is specified for the UserTokenPolicy and SecurityPolicy is None then the password only contains the UTF-8 encoded password. The SecurityPolicy of the SecureChannel is used if no SecurityPolicy is specified in the UserTokenPolicy. The Server shall specify a SecurityPolicy for the UserTokenPolicy if the SecureChannel has a SecurityPolicy other than None and the MessageSecurityMode is not SIGNANDENCRYPT. See Table 193 for possible combinations.
If the token is to be encrypted the password shall be converted to a UTF-8 ByteString, encrypted and then serialized according to the rules for the SecurityPolicy. When using an RSA based SecurityPolicy the password is encrypted and serialized as described in 18.104.22.168. When using the ECC based SecurityPolicies the password is encrypted and serialized as described in 22.214.171.124..
The Server shall decrypt the password and verify the ServerNonce.
If the SecurityPolicy is None then the password only contains the UTF-8 encoded password. This configuration should not be used unless the network traffic is encrypted in some other manner such as a VPN. The use of this configuration without network encryption would result in a serious security fault, in that it would cause the appearance of a secure user access, but it would make the password visible in clear text.
Table 192 defines the UserNameIdentityToken parameter.
Table 192 – UserNameIdentityToken
|policyId||String||An identifier for the UserTokenPolicy that the token conforms to.The UserTokenPolicy structure is defined in 7.42.|
|userName||String||A string that identifies the user.|
|password||ByteString||The password for the user. The password can be an empty string.The format used for the encrypted data is described in 126.96.36.199.|
|encryptionAlgorithm||String||A string containing the URI of the AsymmetricEncryptionAlgorithm. The URI string values are defined names that may be used as part of the security profiles specified in OPC 10000-7.This parameter is null or empty if the password is not encrypted.|
Table 193 describes the dependencies for selecting the AsymmetricEncryptionAlgorithm for the UserNameIdentityToken. The SecureChannel SecurityPolicy URI is specified in the EndpointDescription and used in subsequent OpenSecureChannel requests. The UserTokenPolicy SecurityPolicy URI is specified in the EndpointDescription. The encryptionAlgorithm is specified in the UserNameIdentityToken or IssuedIdentityToken provided by the Client in the ActivateSession call. The SecurityPolicy Other in the table refers to any SecurityPolicy other than None. The selection of the EncryptionAlgorithm is based on the UserTokenPolicy. The SecureChannel SecurityPolicy is used if the UserTokenPolicy is null or empty.
Table 193 – EncryptionAlgorithm selection
|Security Policy - None||NONE||Null or empty||No encryption (a)|
|Security Policy - None||NONE||Security Policy - None||No encryption (a)|
|Security Policy - None||NONE||Security Policy - Other||Asymmetric algorithm for “Other”|
|Security Policy - Other||Other than NONE||Null or empty||Asymmetric algorithm for “Other”|
|Security Policy - Other||Other than NONE||Security Policy - Yet another||Asymmetric algorithm for “Yet another”|
|Security Policy - Other||Other than NONE||Security Policy - Other||Asymmetric algorithm for “Other”|
|Security Policy - Other||SIGNANDENCRYPT||Security Policy - None||No encryption but encrypted SecureChannel|
|Security Policy - Other||SIGN||Security Policy - None||Invalid configuration shall be rejected.|
|(a) The use of this configuration without network encryption would result in a serious security fault.|