-
Hi, I've following Login method:
When I load the react.js page for a first time then after succesfull login to CAS User.Identity?.IsAuthenticated is always false. Next 3 requests to different controller entpoints are causing another calls to login endpoint and finnaly some 500 errors. Sometimes lastcontroller entpoint call is succesful. It seems like controllers calls are made before first login call is finished and HttpContext.User.Identity isnt's yet set. When I reload the page the Login endpoint isn't called at all and everything works fine. I'm using GSS.Authentication.CAS.AspNetCore 5.3.3. I setup CAS service like that:
Anyone can help? |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
Have you check out the ASP.NET Core sample app with React.js? It sounds like was the JavaScript asynchronous programming issue, are you using Promise? Please provide your errors and reproduce-able sample code. |
Beta Was this translation helpful? Give feedback.
-
Yes, we're using Promise. Afer succesful login first request is OK: but then next 3 API requests are causing another CAS calls: ...and errors (http 500): ...but last API call is sucessful: |
Beta Was this translation helpful? Give feedback.
-
I couldn't figure out what the issue was based on your description and screenshots. Can you provide a minimal sample code? |
Beta Was this translation helpful? Give feedback.
-
Which sample code do you need? Our react.js code? |
Beta Was this translation helpful? Give feedback.
-
Just like the ASP.NET Core sample app with React.js, A runnable sample code can re-produce the issue! |
Beta Was this translation helpful? Give feedback.
-
OK, we'll prepare some sample app and let you know. |
Beta Was this translation helpful? Give feedback.
-
Hi @akunzai, We've prepared some demo app but also noticed that both production and demo apps works fine if runned as standalone kestrel apps. If we run them on IIS then we have issue as mentioned above. Our demo app: eProtocols.Simplified.zip |
Beta Was this translation helpful? Give feedback.
-
If this only happens on IIS, perhaps you should check web.config inheritance problems. |
Beta Was this translation helpful? Give feedback.
-
Hi @akunzai, You Was right - It was some kind of inheritance problem. Thank you for your support! |
Beta Was this translation helpful? Give feedback.
If this only happens on IIS,
perhaps you should check web.config inheritance problems.