Open Closed

How to configure CORS? #1345


User avatar
0
hansmogren created

Hi!

In the identity server user interface we can provide allowed cors origins for our clients. Is this supposed to work out-of-the-box or do we need to add code anywhere? Do we need to add the CORS middleware ourselves, and in that case how do we connect it to the clients and origins stored in the IdentityServerClientCorsOrigins table?

  • ABP Framework version: v4.3.0
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

5 Answer(s)
  • User Avatar
    0
    alper created
    Support Team Director

    CORS works but you need to add the production server addresses when you deploy. Also you need to configure IdentityServerClientRedirectUris db table (this is probably configured from the UI)

  • User Avatar
    0
    dwoodard created

    I have a very similar problem. What document covers adding the production servers? Where do I add them?

  • User Avatar
    0
    hansmogren created

    CORS works but you need to add the production server addresses when you deploy. Also you need to configure IdentityServerClientRedirectUris db table (this is probably configured from the UI)

    Thanks for answering. I've added the addresses in the "allowed cors origins" dialog, is there somewhere else they should go? What configuration needs to be done with the IdentityServerClientRedirectUris table?

  • User Avatar
    0
    alper created
    Support Team Director

    the application template comes preconfigured to run Identity Server on your local environment. you need to change the local URLs to your production addresses. check the IdentityServerClientRedirectUris table, you'll see the localhost addresses, replace them with your prod addresses

  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09