RestControllerAdvice not handling exceptions in reactive project - spring

i have not working restcontrolleradvice, when service throwing exception, exception handle should catch it and return bad request code, but it never haping. When i try in postman create user with username or email existed i get error in console, and user not save in base but i still get created response :/
Here is my code of not working service: https://github.com/misterrevo/ProjectOrganizer/tree/master/auth-service

Related

Log all authentication errors Laravel (nova)

I am building an api and my post request return the following message
{"message":"Unauthenticated."}
This messsage is quite unclear. I would like to log more info about the Laravel passport authentication attempts.
I would like to log them to
/storage/logs
Question:
Is it possible to log detailed Auth error messages into the storage log folder?
In your Laravel exception handler file create a custom handler for the
exception that is being thrown that logs more information. On the
OAuthServerException you can call getHint() to get a more specific
error.
References :
I hope Reading following laravel passport github issues will help you
https://github.com/laravel/passport/issues/403
https://github.com/laravel/passport/issues/289

Microsoft UCMA 4.0 API QuickStart App for skype

i'm using Microsoft UCMA 4.0 API QuickStart App AudioVideo Recorder for Skype for Business. When i call user from inside organization, i can contact and record voice.
We have federation with external skype users. When i try to call external sip name.surname(gmail.com)#msn.com i'm getting exeption:
An exception of type 'Microsoft.Rtc.Signaling.RegisterException' occurred in Microsoft.Rtc.Collaboration.dll but was not handled in user code
Additional information: The endpoint was unable to register. See the ErrorCode for specific reason.
Here is the procedure:
private void EndEndpointEstablish(IAsyncResult ar)
{
LocalEndpoint currentEndpoint = ar.AsyncState as LocalEndpoint;
try
{
currentEndpoint.EndEstablish(ar);
}
catch (AuthenticationException authEx)
{
// AuthenticationException will be thrown when the credentials are invalid.
Console.WriteLine(authEx.Message);
throw;
}
catch (ConnectionFailureException connFailEx)
{
// ConnectionFailureException will be thrown when the endpoint cannot connect to the server, or the credentials are invalid.
Console.WriteLine(connFailEx.Message);
throw;
}
catch (InvalidOperationException iOpEx)
{
// InvalidOperationException will be thrown when the endpoint is not in a valid state to connect. To connect, the platform must be started and the Endpoint Idle.
Console.WriteLine(iOpEx.Message);
throw;
}
finally
{
// Again, just for sync. reasons.
_endpointInitCompletedEvent.Set();
}
}
How can we reach external users?
After few hours tried second time to call inside user and it is not working. Now getting message:
An exception of type 'Microsoft.Rtc.Signaling.AuthenticationException' occurred in RecorderSample.exe but was not handled in user code
Additional information: Not authorized to perform the requested operation, request is refused
Why i'm not authorized suddenly?
I think you are getting confused.
UCMA applications create and service sip endpoints. A sip endpoint is like a "phone" in that it can make and receive audio / video calls, IMs, etc.
There are two types of endpoints a UCMA application can create:
UserEndpoint
ApplicationEndpoint
Both types of endpoints are pre-defined types of users in Lync.
Sip endpoints need to register with the sip registrar (Lync Front End) which is like pluging a phone into the wall. It's says I'm here, if you get any calls for 'X' send them my way.
So you have done is try to "Register" a sip endpoint that is "name.surname(gmail.com)#msn.com" with your local Lync Front End. This is illegal, which is why you are getting the "Microsoft.Rtc.Signaling.RegisterException" errors.
What you may want to do is register a "local" Lync user and then "dial" the federated account OR get the federated account to dial you.

No access to Session on Error 400

I'm having an issue with how to handle Bad Request (Error 400) in my MVC 4 application. I followed this article: http://www.digitallycreated.net/Blog/57/getting-the-correct-http-status-codes-out-of-asp.net-custom-error-pages to get my error pages setup to send the proper response codes. It works for all the codes I've tested so far (403, 404, and 500). But I'm having troubles with the 400 error code because I lose access to Session and User objects when the error is thrown. I am using Session and User to generate the menus (different users can see different menus depending on their role). So when I call to the menu controller to generate the menu, it throws a null ref exception because there isn't a Session or User object. I read that I don't have access to Session until after AcquireRequestState event is raised. So I suspect I haven't gotten there yet (how can I check this in debugger?). What other options do I have? I was thinking I could store the information in a cookie instead of the session, but I'd rather not...

Not able to get a request token using /oauth/initiate in Magento. Error says - oauth_parameters_absent=oauth_token

I've been trying to authenticate my oAuth consumer to the Magento application for 2 weeks now. I just can't seem to get a break through.
I've configured the REST roles and attributes to make everything accessible. Now the next step is to get a request token.
I've been trying to authenticate using Google Chrome's REST client at the url - /oauth/initiate. I've entered all the parameters needed to authenticate the app namely -
consumer key, consumer secret, oauth version, timestamp, nonce, signature method.
But the error I get is this -
{
messages: {
error: [1]
0: {
code: 401
message: "oauth_problem=parameter_absent&oauth_parameters_absent=oauth_token"
}
}
}
Which seems very strange to me, cause there are no parameters absent from what I can make out. Someone please help me out. I've been stuck on this badly.
It means that Magento isn't returning the parameter oauth_token.
So there is something else wrong with your request. The first time I ran into this, it was because I wasn't providing an oauth_callback parameter.

Grails never redirect to login page

How to force a user to go to login page if he tries to access protected resource?
I am trying to implement ajax-based authentication. Simple logging-in and logging-out procedure seems to work fine, but whenever i try to access a resource that requires logging in all i get is an 404 error (in html body i see 403 error instead).

Resources