Skip to content

Commit

Permalink
reuse the identity policy in the reconnect that has been used in the …
Browse files Browse the repository at this point in the history
…connect (#2526)

* May cause an issue if a server specifies e.g. multiple policy id for UserName/Password with different security profiles
  • Loading branch information
KircMax authored Feb 23, 2024
1 parent 6d85d80 commit f91644e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Applications/ConsoleReferenceClient/UAClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ public async Task<bool> ConnectAsync(string serverUrl, bool useSecurity = true,
m_configuration.ApplicationName,
SessionLifeTime,
UserIdentity,
null
null,
ct
).ConfigureAwait(false);

// Assign the created session
Expand Down
3 changes: 1 addition & 2 deletions Libraries/Opc.Ua.Client/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5523,8 +5523,7 @@ ITransportChannel transportChannel
EndpointDescription endpoint = m_endpoint.Description;
SignatureData clientSignature = SecurityPolicies.Sign(m_instanceCertificate, endpoint.SecurityPolicyUri, dataToSign);

// check that the user identity is supported by the endpoint.
UserTokenPolicy identityPolicy = endpoint.FindUserTokenPolicy(m_identity.TokenType, m_identity.IssuedTokenType);
UserTokenPolicy identityPolicy = m_endpoint.Description.FindUserTokenPolicy(m_identity.PolicyId);

if (identityPolicy == null)
{
Expand Down

0 comments on commit f91644e

Please sign in to comment.