Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find ANONYMOUS user token policy in end point description #39

Open
guenhter opened this issue Jun 16, 2023 · 3 comments
Open

Cannot find ANONYMOUS user token policy in end point description #39

guenhter opened this issue Jun 16, 2023 · 3 comments

Comments

@guenhter
Copy link

Hi

when I run this OPC-UA sample server https://github.com/locka99/opcua/tree/master/samples/simple-server

Then then try to open the Commander on it, I get this error:

Cannot create session Error: Cannot find ANONYMOUS user token policy in end point description

As described in node-opcua/node-opcua#693 I ran the get_endpoint gist, and here is the output of it:

securityMode        =  1
securityPolicy      =  http://opcfoundation.org/UA/SecurityPolicy#None
05:55:28.255Z :opcua_client_impl             :342   Warning: endpoint_must_exist is now deprecated, use endpointMustExist instead
 connecting to  opc.tcp://127.0.0.1:4855
    strategy {
  initialDelay: 2000,
  maxDelay: 10000,
  maxRetry: 10,
  randomisationFactor: 0
}
endpoint                           Application URI           Product URI                       Application Name      securityLevel  Security Mode   securityPolicyUri                                                 Type    certificate  discoveryUrls
---------------------------------  ------------------------  --------------------------------  --------------------  -------------  --------------  ----------------------------------------------------------------  ------  -----------  -------------------------
opc.tcp://127.0.0.1:4855/          urn:OPC UA Sample Server  urn:OPC UA Sample Server Testkit  OPC UA Sample Server  2              Sign            http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep  Server  ...          opc.tcp://127.0.0.1:4855/
opc.tcp://127.0.0.1:4855/          urn:OPC UA Sample Server  urn:OPC UA Sample Server Testkit  OPC UA Sample Server  12             SignAndEncrypt  http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep  Server  ...          opc.tcp://127.0.0.1:4855/
opc.tcp://127.0.0.1:4855/          urn:OPC UA Sample Server  urn:OPC UA Sample Server Testkit  OPC UA Sample Server  5              Sign            http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss   Server  ...          opc.tcp://127.0.0.1:4855/
opc.tcp://127.0.0.1:4855/          urn:OPC UA Sample Server  urn:OPC UA Sample Server Testkit  OPC UA Sample Server  15             SignAndEncrypt  http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss   Server  ...          opc.tcp://127.0.0.1:4855/
opc.tcp://127.0.0.1:4855/          urn:OPC UA Sample Server  urn:OPC UA Sample Server Testkit  OPC UA Sample Server  1              Sign            http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15          Server  ...          opc.tcp://127.0.0.1:4855/
opc.tcp://127.0.0.1:4855/          urn:OPC UA Sample Server  urn:OPC UA Sample Server Testkit  OPC UA Sample Server  11             SignAndEncrypt  http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15          Server  ...          opc.tcp://127.0.0.1:4855/
opc.tcp://127.0.0.1:4855/          urn:OPC UA Sample Server  urn:OPC UA Sample Server Testkit  OPC UA Sample Server  3              Sign            http://opcfoundation.org/UA/SecurityPolicy#Basic256               Server  ...          opc.tcp://127.0.0.1:4855/
opc.tcp://127.0.0.1:4855/          urn:OPC UA Sample Server  urn:OPC UA Sample Server Testkit  OPC UA Sample Server  13             SignAndEncrypt  http://opcfoundation.org/UA/SecurityPolicy#Basic256               Server  ...          opc.tcp://127.0.0.1:4855/
opc.tcp://127.0.0.1:4855/          urn:OPC UA Sample Server  urn:OPC UA Sample Server Testkit  OPC UA Sample Server  4              Sign            http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256         Server  ...          opc.tcp://127.0.0.1:4855/
opc.tcp://127.0.0.1:4855/          urn:OPC UA Sample Server  urn:OPC UA Sample Server Testkit  OPC UA Sample Server  14             SignAndEncrypt  http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256         Server  ...          opc.tcp://127.0.0.1:4855/
opc.tcp://127.0.0.1:4855/noaccess  urn:OPC UA Sample Server  urn:OPC UA Sample Server Testkit  OPC UA Sample Server  0              None            http://opcfoundation.org/UA/SecurityPolicy#None                   Server  ...          opc.tcp://127.0.0.1:4855/
opc.tcp://127.0.0.1:4855/          urn:OPC UA Sample Server  urn:OPC UA Sample Server Testkit  OPC UA Sample Server  0              None            http://opcfoundation.org/UA/SecurityPolicy#None                   Server  ...          opc.tcp://127.0.0.1:4855/

Identify Token for : Security Mode= Sign  Policy= http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep
policyId           tokenType  issuedTokenType  issuerEndpointUrl  securityPolicyUri
-----------------  ---------  ---------------  -----------------  --------------------------------------------------------
anonymous          0          null             null               null
userpass_rsa_oaep  1          null             null               null
x509               2          null             null               http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15

Identify Token for : Security Mode= SignAndEncrypt  Policy= http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep
policyId           tokenType  issuedTokenType  issuerEndpointUrl  securityPolicyUri
-----------------  ---------  ---------------  -----------------  --------------------------------------------------------
anonymous          0          null             null               null
userpass_rsa_oaep  1          null             null               null
x509               2          null             null               http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15

Identify Token for : Security Mode= Sign  Policy= http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss
policyId           tokenType  issuedTokenType  issuerEndpointUrl  securityPolicyUri
-----------------  ---------  ---------------  -----------------  --------------------------------------------------------
anonymous          0          null             null               null
userpass_rsa_oaep  1          null             null               null
x509               2          null             null               http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15

Identify Token for : Security Mode= SignAndEncrypt  Policy= http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss
policyId           tokenType  issuedTokenType  issuerEndpointUrl  securityPolicyUri
-----------------  ---------  ---------------  -----------------  --------------------------------------------------------
anonymous          0          null             null               null
userpass_rsa_oaep  1          null             null               null
x509               2          null             null               http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15

Identify Token for : Security Mode= Sign  Policy= http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15
policyId         tokenType  issuedTokenType  issuerEndpointUrl  securityPolicyUri
---------------  ---------  ---------------  -----------------  --------------------------------------------------------
anonymous        0          null             null               null
userpass_rsa_15  1          null             null               null
x509             2          null             null               http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15

Identify Token for : Security Mode= SignAndEncrypt  Policy= http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15
policyId         tokenType  issuedTokenType  issuerEndpointUrl  securityPolicyUri
---------------  ---------  ---------------  -----------------  --------------------------------------------------------
anonymous        0          null             null               null
userpass_rsa_15  1          null             null               null
x509             2          null             null               http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15

Identify Token for : Security Mode= Sign  Policy= http://opcfoundation.org/UA/SecurityPolicy#Basic256
policyId           tokenType  issuedTokenType  issuerEndpointUrl  securityPolicyUri
-----------------  ---------  ---------------  -----------------  --------------------------------------------------------
anonymous          0          null             null               null
userpass_rsa_oaep  1          null             null               null
x509               2          null             null               http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15

Identify Token for : Security Mode= SignAndEncrypt  Policy= http://opcfoundation.org/UA/SecurityPolicy#Basic256
policyId           tokenType  issuedTokenType  issuerEndpointUrl  securityPolicyUri
-----------------  ---------  ---------------  -----------------  --------------------------------------------------------
anonymous          0          null             null               null
userpass_rsa_oaep  1          null             null               null
x509               2          null             null               http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15

Identify Token for : Security Mode= Sign  Policy= http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256
policyId           tokenType  issuedTokenType  issuerEndpointUrl  securityPolicyUri
-----------------  ---------  ---------------  -----------------  --------------------------------------------------------
anonymous          0          null             null               null
userpass_rsa_oaep  1          null             null               null
x509               2          null             null               http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15

Identify Token for : Security Mode= SignAndEncrypt  Policy= http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256
policyId           tokenType  issuedTokenType  issuerEndpointUrl  securityPolicyUri
-----------------  ---------  ---------------  -----------------  --------------------------------------------------------
anonymous          0          null             null               null
userpass_rsa_oaep  1          null             null               null
x509               2          null             null               http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15

Identify Token for : Security Mode= None  Policy= http://opcfoundation.org/UA/SecurityPolicy#None



Identify Token for : Security Mode= None  Policy= http://opcfoundation.org/UA/SecurityPolicy#None
policyId       tokenType  issuedTokenType  issuerEndpointUrl  securityPolicyUri
-------------  ---------  ---------------  -----------------  --------------------------------------------------------
anonymous      0          null             null               null
userpass_none  1          null             null               null
x509           2          null             null               http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15

success !!

Any idea why this happens?

@Schloemicher
Copy link

I got this error after I messed up providing a password via environment variables.

When no password is provided the anonymous policy is used -> which is unavailable on my server.

@erossignon
Copy link
Member

You server has a opc.tcp://127.0.0.1:4855/noaccess anonymoys connection and I suspect that the server reject access.

@marutimuthu
Copy link

marutimuthu commented Oct 23, 2023

This error is due to anonymous login being disabled by default in Kepserver.

To allow anonymous login: Edit -> Properties -> OPC UA -> Allow Anonymous Login -> Yes

I was facing the same issue and it was resolved after anonymous login was enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants