react-oidc icon indicating copy to clipboard operation
react-oidc copied to clipboard

Once authenticated, I am observing several hundred network requests

Open cousinanthony opened this issue 3 years ago • 4 comments

I believe have nearly duplicated the example in the Quick start section. I configure my example to points to my identity server which is implemented using IdentityServer4

When I run the application it redirects me to my login page. I log in and it redirect back to my callback and finally display the content with in my <AppWithAuth/>

With Fiddler enabled, I see that the follow calls are executing ../connect/checksession ../connect/authorize?client_id=.. ../.well-known/openid-configuration

This loop occurs about 100 times and then aborts.

I must be missing subtle import step.

Anthony

cousinanthony avatar Mar 19 '21 21:03 cousinanthony

Following the instructions as instructed, I have the same issue. Chrome dev tools network tab request waterfall shows same pattern of requests again and again approximately 7 times which leads to 400 requests

sametmasaci avatar Apr 06 '21 06:04 sametmasaci

@sam541 I have tried some other active libraries and see similar types of issues. While on the surface it appears to be working, there are a number of warnings in the console log. My next attempt will be to use the Oidc-client directly.

cousinanthony avatar Apr 06 '21 23:04 cousinanthony

@cousinanthony The issue with my project was this. I was getting "login_required" error from connect/checksession iframe. Reading through oidc client library issues I am pretty sure that it is about chrome blocking non same site insecure cookies(not using ssl or same domain). So I was wrong about telling that this library had problem. Browsing my site on Firefox shows correct behaviour.

My recommendation to you or anyone having issues use debugging or onerror event to find out the root of the cause. If there is not an error any place. It might be a code block within react lifecycle that reloads page or your react routing strategy might be wrong

sametmasaci avatar Apr 06 '21 23:04 sametmasaci

@sam541 I was getting the "login_required" error with another library and one another point errors related to IFRAME and not being the same origin. My identity server is on one of our QA servers and I am testing from my dev machine, but I think I have gotten past that error. I have tested with both Safari and Chrome. I will give FireFox a true.

cousinanthony avatar Apr 06 '21 23:04 cousinanthony