Skip to content

Commit

Permalink
Add policy URI to each endpoint token's SecurityPolicyUri
Browse files Browse the repository at this point in the history
  • Loading branch information
haotruongnhat authored and oroulet committed Oct 16, 2024
1 parent 8a6018f commit 4711121
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions asyncua/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,20 +497,23 @@ def _set_endpoints(self, policy=ua.SecurityPolicy, mode=ua.MessageSecurityMode.N
idtoken = ua.UserTokenPolicy()
idtoken.PolicyId = "anonymous"
idtoken.TokenType = ua.UserTokenType.Anonymous
idtoken.SecurityPolicyUri = policy.URI
idtokens.append(idtoken)
supported_token_classes.append(ua.AnonymousIdentityToken)

if "Basic256Sha256" in self._policyIDs:
idtoken = ua.UserTokenPolicy()
idtoken.PolicyId = 'certificate_basic256sha256'
idtoken.TokenType = ua.UserTokenType.Certificate
idtoken.SecurityPolicyUri = policy.URI
idtokens.append(idtoken)
supported_token_classes.append(ua.X509IdentityToken)

if "Username" in self._policyIDs:
idtoken = ua.UserTokenPolicy()
idtoken.PolicyId = "username"
idtoken.TokenType = ua.UserTokenType.UserName
idtoken.SecurityPolicyUri = policy.URI
idtokens.append(idtoken)
supported_token_classes.append(ua.UserNameIdentityToken)

Expand Down

0 comments on commit 4711121

Please sign in to comment.