Aperto Chiuso

How to configure CORS? #1345


User avatar
0
hansmogren creato

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 risposte
  • User Avatar
    0
    alper creato
    Team di supporto 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 creato

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

  • User Avatar
    0
    hansmogren creato

    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 creato
    Team di supporto 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 creato
    Team di supporto Automatic process manager

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

Made with ❤️ on ABP v8.2.0-preview Updated on marzo 25, 2024, 15:11