Hi Intelicosmos,
From the screenshots you provided, you've done a good job setting up the roles for A
, B
, C
, and D
. However, the runtime error in the MAUI client:
“The client does not have permission to join group 'abc'”
indicates that the generated access token did not include the correct joinLeaveGroup.abc
permission, even though it seems you intended to include it.
Looking at your variable expansion (all_roles
list):
['webpubsub.sendToGroup.',
'webpubsub.joinLeaveGroup.7',
'webpubsub.sendToGroup.7',
'webpubsub.joinLeaveGroup.',
'webpubsub.sendToGroup.',
'webpubsub.joinLeaveGroup',
'webpubsub.sendToGroup.I_']
The correct role webpubsub.joinLeaveGroup.abc
is present, but it is at the 6th index of the list, meaning it is very likely that your MAUI app is initialized with an outdated token, the one before this role was added.
- Verify Token Contents to ensure the token includes the right group roles, please decode the JWT using Microsoft’s secure tool: https://jwt.ms
- Paste in the token returned by
get_client_access_token()
- Look for:
"roles": [ "webpubsub.joinLeaveGroup.I", "webpubsub.sendToGroup.I", ... ]
- If
joinLeaveGroup.Iabc
is missing, then your MAUI app is running with an old or mismatched token.
- Paste in the token returned by
- Ensure Re-initialization in MAUI App
- Confirm that after generating the token in Python, the MAUI app reconnects using the new token by reinitializing the
WebPubSubClient
. Example:_client = new WebPubSubClient(new Uri(newTokenUrl)); await _client.StartAsync(); await _client.JoinGroupAsync("I_abc"); // Ensure this group name matches exactly
- Confirm that after generating the token in Python, the MAUI app reconnects using the new token by reinitializing the