Skip to main content
Question

Connect to SignalR with Java Client

  • February 18, 2025
  • 2 replies
  • 22 views

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

2 replies

chameera71
Varsity I
Forum|alt.badge.img+2
  • Varsity I
  • 56 replies
  • 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.

 


  • Author
  • Freshman I
  • 2 replies
  • 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?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings