Ignore login pop up when BAP client requests to platform server

If a pop up like that appears in BAP Client

and when you check your requests, you see it sent a GET request to /api/user/data and returned error 401

It happened to me because I called function restoreAuthenticationState of platformServerConnectors to keep user logged in after browser refresh. This function call request GET /api/user/data, and because it is called before users login, so it can not add your encrypt authorization to header, then platform server returns error 401.

To ignore this pop up, you don’t need to change anything in BAP Client, just add some config to platform server in your application.properties:

mgm.services.rest.security.additionalFilterConfiguration[0].key=/api/user/data
mgm.services.rest.security.additionalFilterConfiguration[0].value=anon

Well I do not know how much this is actually topic for services because from the point of view of services you have issued request to the resource which you have not been authorized to see (yet). So you get correct response. The issue here is on the client side because the request that is being sent should follow after login request

Thank you so much.
I agree with you that it should be called after login request. I’ve just double checked and I confirm that if users already logged in and then they refresh browser when nothing is expired, the pop up won’t appear.
But the problem that client can not sure 100% that server still keep their authentication state. For example in case users just login on client, and then we restart server, then they refresh browser, they will see the pop up.
Anyway, I already moved this topic to Client :slight_smile:
@quang-calm-slope: we should discuss to find the best solution for this problem.

Are you sure that the restart of server and refresh of browser is a use case that we should support ?

I think we should support use case user refresh browser, because it’s normal.
And the problem when we restart server is related to this use case, so we should consider about it.