abp icon indicating copy to clipboard operation
abp copied to clipboard

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource

Open mnaveedtkxel opened this issue 5 years ago • 4 comments

ABP version 4.4 APP with identity server with angular EF core

my angular client send the username and password to identity server that is part of my abp application (mean same URL for api and identity server) that returns me token but after very next request for "api/abp/application-configuration" return with CORs error. same application work for QA local environment with local config. same call for "api/abp/application-configuration" work on app start because that time token is not attached in request header i check my app setting CorsOrigins are matching with IdentityServerClientCorsOrigins no space issue both angular and front end on https but with different port. you can verify with logs. one thing is strange in log no protocol attach @ respond. (domain:1000)

i check and confirm that this is Authentication issue. by comment these two line and Authorize attribute from class app.UseAuthentication(); app.UseJwtTokenMiddleware(); My application works fine. no issue for cors

2021-09-04 10:42:24.731 -04:00 [INF] Request starting HTTP/2 OPTIONS https://domain:1000/.well-known/openid-configuration - - 2021-09-04 10:42:24.745 -04:00 [INF] CORS policy execution successful. 2021-09-04 10:42:24.751 -04:00 [INF] Request finished HTTP/2 OPTIONS https://domain:1000/.well-known/openid-configuration - - - 204 - - 19.7919ms 2021-09-04 10:42:24.793 -04:00 [INF] Request starting HTTP/2 GET https://domain:1000/.well-known/openid-configuration - - 2021-09-04 10:42:24.794 -04:00 [INF] CORS policy execution successful. 2021-09-04 10:42:46.050 -04:00 [ERR] Exception occurred while processing message. System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'System.String'. ---> System.IO.IOException: IDX20804: Unable to retrieve document from: 'System.String'. ---> System.Net.Http.HttpRequestException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (domain:1000) ---> System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

mnaveedtkxel avatar Sep 04 '21 15:09 mnaveedtkxel

Did you create the seed data correctly?

Check your IdentityServerClientCorsOrigins table

realLiangshiwei avatar Sep 04 '21 23:09 realLiangshiwei

i double check the entry of the table. i works fine in browser.

mnaveedtkxel avatar Sep 05 '21 01:09 mnaveedtkxel

@mnaveedtkxel Did you ever get this to work? I am having the same issue on IIS. Windows Server 2019.

This is driving me nuts. I have been over every setting 20 times! Just like you I can visit the endpoint in the browser.

pagner avatar Oct 23 '21 18:10 pagner

DNS entries create issues in my network. After the fix that site is up and running. IdentityServerClient Seed already verified.

On Sat, Oct 23, 2021 at 11:27 PM pagner @.***> wrote:

@mnaveedtkxel https://github.com/mnaveedtkxel Did you ever get this to work? I am having the same issue on IIS. Windows Server 2019.

This is driving me nuts. I have been over every setting 20 times! Just like you I can visit the endpoint in the browser.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/abpframework/abp/issues/9967#issuecomment-950193511, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVADWQNOQEY2BWL4RLTEH4LUIL5CRANCNFSM5DNMSKJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mnaveedtkxel avatar Oct 25 '21 06:10 mnaveedtkxel