Currently rhoconnect does not support custom http response messages in the authenticate route. This is the case whether or not you're using plugins like the .NET one. When you say `Rho::Exception::LoginException` are you referring to the source adapter exception api? If so that exception is only designed to be used from inside the source adapter model code, as it's a ruby api.
There are two workarounds:
1) Encode an error message in the username along with a non-200 response code
2) Return the error in one of the models (i.e. the one you designate with the first sync priority)
USER03520 please correct me if I'm wrong here or I'm missing something.
First option (encoding error message into the returned user-name) won't work. We only use that when code is 200. It should never be used in case of error.
Second option (returning the error in a first synced model) also won't work because syncing is possible only after the authentication had succeeded, i.e. user is created. Here, situation is different.
Currently, where would be no way to return custom error message to the client from the plugin. DynamicAdapter (which handles the plugins) does not store this info.
The only thing that can potentially work - is to implement in .NET some route that says "Last_Error" and call it directly from the client.
This should be considered as a future enhancement. We can parse the response from the plugin and post it back to the client instead of default LoginException response.
Thanks Lars/Maxim; that all makes sense.
In the end we selected some appropriate non 200 'well known' (between client and Backend App) Http Response Status Codes that the client grabs out of @params['error_message'] in the login_callback and interprets the error into a meaningful message for the user. Does the job, close enough.
Your responses at least helped me understand what was going on and what was possible here..