Skip to content

UserTokenPolicy with SecurityPolicyUri blank instead of null #219

@damianozucconi

Description

@damianozucconi

Hi,
I'm using UA-Java-Legacy 1.4.1 connecting to a Schneider PLC endpoint with security none. I found that its EndpointDescription contains a UserTokenPolicy UserName with SecurityPolicyUri = "" (not null)
So when I try to activate sessionchannel with username and password, EndpointUtil.createUserNameIdentityToken throws exception with message
UserName not supported
despite of it is actually available
This is caused by EndpointDescription.findUserTokenPolicy that uses SecurityPolicy.getSecurityPolicy and checks:
if (securityPolicyUri == null) return NONE;
but not something like
if (securityPolicyUri == null || securityPolicyUri.trim().equals("")) return NONE;

So a connection with UAExpert is possible (with a security warning because account data is not encrypted) but with UA-Java-Legacy I get a UserName not supported message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions