Harriet_Kim_1764

How to Connect to ARA REST API with Two Clients

Discussion created by Harriet_Kim_1764 on Sep 28, 2017
A user has two clients in ARA and wants to connect both clients via REST API.  They are able to connect to the first client, but gets an error when attempting to connect to the second client.

Error:

Ventum.Bond2.Services.InvalidUserNameException: username = <Client>/<USER>/<Dept>; defaultTenantId = AUTOMDEV/200\r\n   at Ventum.Bond2.Services.UserNameNormalizer.NormalizeUserName(String username, String defaultTenantId) in E:\\BuildAgent\\work\\bondrelease\\7.0.2.3@12.0.2\\Projects\\Ventum.Bond2.Services\\Services\\UserNameNormalizer.cs:line 34\r\n   at Ventum.Bond2.Services.Impl.AuthenticationService.NormalizeUserNameForLogin(String userName) in E:\\BuildAgent\\work\\bondrelease\\7.0.2.3@12.0.2\\Projects\\Ventum.Bond2.Services.Impl\\Services.Impl\\AuthenticationService.cs:line 0\r\n   at Ventum.Bond2.Services.Impl.AuthenticationService.Login(String username, String password, UserIdentity& identity, LoginOption loginOption) in E:\\BuildAgent\\work\\bondrelease\\7.0.2.3@12.0.2\\Projects\\Ventum.Bond2.Services.Impl\\Services.Impl\\AuthenticationService.cs:line 151\r\n   at Ventum.Bond2.Api.WebApi.Filter.Authentication.BasicAuthenticationAttribute.AuthenticateAsync(String userName, String password, CancellationToken cancellationToken) in E:\\BuildAgent\\work\\bondrelease\\7.0.2.3@12.0.2\\Projects\\Ventum.Bond2.Api\\WebApi\\Filter\\Authentication\\BasicAuthenticationAttribute.cs:line 96\r\n   at Ventum.Bond2.Api.WebApi.Filter.Authentication.BasicAuthenticationAttribute.<AuthenticateAsync>d__7.MoveNext() in E:\\BuildAgent\\work\\bondrelease\\7.0.2.3@12.0.2\\Projects\\Ventum.Bond2.Api\\WebApi\\Filter\\Authentication\\BasicAuthenticationAttribute.cs:line 59\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext() 


Solution:
For REST API, additional information is required to pass to the ARA server when using two or more clients.

With a single client, the user format is like this:

Client_number/Name/Department

Example:
100/ARA/TEST

With two or more clients, the user format is like this:

AE_system_name/Client_number/Name/Department

Example:
AEDEV/200/ARA_USER/TEST

------------------------------------------------------------
I would like to thank @Hau Tran-Hoang for his help!

Outcomes