Skip to main content
Solved

Connect to SignalR with Java Client

  • February 18, 2025
  • 4 replies
  • 96 views

Forum|alt.badge.img

Hi all,

My objective is to connect my java client with the SignalR Hub.

I added a push-notification with Destination Type SignalR Hub as it is described here: Push Notifications: To Connect to the SignalR Hub.

I use the following code snippet to connect my client with the SignalR Hub:

String login = "<my_user>";
String tenant = "<my_tenant>";
String password = "<my_password>";

String basicAuthPlain = login + "@" + tenant + ":" + password;
String encodedBasicAuth = Base64.getEncoder().encodeToString(basicAuthPlain.getBytes());

HubConnection hubConnection = HubConnectionBuilder.create("https://<my_x360_domain>/PushNotificationsHub")
.withHeader("Authorization", "Basic " + encodedBasicAuth)
.build();

hubConnection.start().blockingAwait(30, TimeUnit.SECONDS);

...

 

However, after executing start().blockingAwait() I receive the http status 401.

Do I miss something? Can anyone tell me how I can sucessfully connect/authenticate the client?

 

Thanks in advance

Best answer by BEXJens

@Chris Hackett 

No, sadly not. I used webhooks instead of Signal R.

4 replies

chameera71
Varsity II
Forum|alt.badge.img+4
  • Varsity II
  • February 21, 2025

When your Java client's authentication credentials are rejected by the Acumatica SignalR Hub, you get the HTTP 401 Unauthorized error. Usually, this occurs because of:

Inaccurate Credentials: The password, tenant, or username might not be correct or formatted correctly. Verify that the username@tenant:password string is Base64 encoded correctly.


SignalR Hub URL: The following URL may be inaccurate or unavailable: https:///PushNotificationsHub.

Authentication Method: Your Acumatica instance might not support or be configured correctly for Basic Authentication. For safe and dependable authentication, OAuth is advised.

Configuring SignalR: Verify that SignalR is turned on in Acumatica by going to System > Management > Push Notifications.

 

To fix this:

  • Verify credentials and URL.

  • Use OAuth for authentication: Obtain an access token from Acumatica’s OAuth endpoint and connect to the SignalR Hub using the Bearer token.

  • Check Acumatica logs for detailed error messages.

Switching to OAuth and ensuring proper configuration should resolve the issue

 

Note: Support of an AI tool is used to generate this response.

 


Forum|alt.badge.img
  • Author
  • Freshman II
  • February 21, 2025

Thanks for the response. I already tried everything you mentioned. 

  • The credentials are correct. I tried it with the route /entity/auth/login.
  • I also tried it with a valid Bearer token.

 

Where can I find the logs in Acumatica . Can you name me the screen ID?


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • May 27, 2025

Hi ​@BEXJens were you able to find a solution? Thank you!


Forum|alt.badge.img
  • Author
  • Freshman II
  • Answer
  • May 30, 2025

@Chris Hackett 

No, sadly not. I used webhooks instead of Signal R.