Skip to content

Commit

Permalink
webpubsub, fix "audience" bug in async client (#32357)
Browse files Browse the repository at this point in the history
  • Loading branch information
weidongxu-microsoft authored Dec 20, 2022
1 parent 8114b3b commit 44fba09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions sdk/webpubsub/azure-messaging-webpubsub/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### Bugs Fixed

- Fixed incorrect "audience" from `getClientAccessToken` method in `WebPubSubServiceAsyncClient`. ([#24741](https://github.com/Azure/azure-sdk-for-java/issues/24741))

### Other Changes

## 1.1.8 (2022-11-09)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public Mono<WebPubSubClientAccessToken> getClientAccessToken(GetClientAccessToke
});
}
return Mono.defer(() -> {
final String audience = endpoint + "client/hubs/" + hub;
final String audience = endpoint + (endpoint.endsWith("/") ? "" : "/") + "client/hubs/" + hub;
final String token = WebPubSubAuthenticationPolicy.getAuthenticationToken(
audience, options, keyCredential);
return Mono.just(WebPubSubUtil.createToken(token, endpoint, hub));
Expand Down

0 comments on commit 44fba09

Please sign in to comment.