Skip to content

Commit 9dac51b

Browse files
authored
[Server] [Client] Return BadIdentityTokenInvalid if use of anonymous identity token is not allowed (#3012)
* make Server return BadIdentityTokenInvalid if use of anonymous identity token is not allowed * Change Response Code on Client side also to be consistent * change response code ro BadIdentityTokenRejected
1 parent bba6d72 commit 9dac51b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Libraries/Opc.Ua.Client/Session/Session.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5425,7 +5425,7 @@ private void OpenValidateIdentity(
54255425
if (identityPolicy == null)
54265426
{
54275427
throw ServiceResultException.Create(
5428-
StatusCodes.BadUserAccessDenied,
5428+
StatusCodes.BadIdentityTokenRejected,
54295429
"Endpoint does not support the user identity type provided.");
54305430
}
54315431

Libraries/Opc.Ua.Server/Session/Session.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ private UserIdentityToken ValidateUserIdentityToken(
902902

903903
if (!found)
904904
{
905-
throw ServiceResultException.Create(StatusCodes.BadUserAccessDenied, "Anonymous user token policy not supported.");
905+
throw ServiceResultException.Create(StatusCodes.BadIdentityTokenRejected, "Anonymous user token policy not supported.");
906906
}
907907
}
908908

0 commit comments

Comments
 (0)