Open Closed

How to configure the wild card domain in identity sever 4 client cors #2525


User avatar
0
KuldeepRathi created

when we configure the wild card domain in identity server 4 client cors, it gives the error,

Error logs, [07:36:55 DBG] Start token request. [07:36:55 DBG] Start client validation [07:36:55 DBG] Start parsing Basic Authentication secret [07:36:55 DBG] Start parsing for secret in post body [07:36:55 DBG] Parser found secret: PostBodySecretParser [07:36:55 DBG] Secret id found: Civit.Admin [07:36:56 ERR] Invalid client configuration for client Admin: AllowedCorsOrigins contains invalid origin: https://{0}.test.in [07:36:56 INF] {"ClientId": "Admin", "ClientName": "Admin", "Category": "Error", "Name": "Invalid Client Configuration", "EventType": "Error", "Id": 3001, "Message": "AllowedCorsOrigins contains invalid origin: https://{0}.test.in", "ActivityId": "0HMF63R3IBHP2:00000002", "TimeStamp": "2022-02-02T07:36:56.0000000Z", "ProcessId": 1, "LocalIpAddress": "::ffff:172.19.0.2:44374", "RemoteIpAddress": "::ffff:172.19.0.1", "$type": "InvalidClientConfigurationEvent"} [07:36:56 INF] {"ClientId": "Admin", "Category": "Authentication", "Name": "Client Authentication Failure", "EventType": "Failure", "Id": 1011, "Message": "Unknown client", "ActivityId": "0HMF63R3IBHP2:00000002", "TimeStamp": "2022-02-02T07:36:56.0000000Z", "ProcessId": 1, "LocalIpAddress": "::ffff:172.19.0.2:44374", "RemoteIpAddress": "::ffff:172.19.0.1", "$type": "ClientAuthenticationFailureEvent"} [07:36:56 ERR] No client with id 'Admin' found. aborting [07:36:56 INF] Request finished HTTP/1.0 POST https://localhost:44315/connect/token application/x-www-form-urlencoded 150 - 400 - application/json;+charset=UTF-8 4603.2315ms

how to resolve this error, or what is the configuration for the identity server 4 client cors origins for the wild card domain


2 Answer(s)
  • User Avatar
    0
    MichelZ created

    I think for CORS you need to use * instead of {0}

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    We have a sample.

    https://github.com/abpframework/abp-samples/tree/master/DomainTenantResolver

    https://github.com/abpframework/abp-samples/blob/master/DomainTenantResolver/MVC-TIERED/src/Acme.BookStore.IdentityServer/BookStoreIdentityServerModule.cs#L55-L61

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