Starts in:
1 DAY
19 HRS
46 MIN
6 SEC
Starts in:
1 D
19 H
46 M
6 S
Open Closed

Keycloak Swagger Client on KeycloakDemo #3840


User avatar
2
uyarbtrlp created

Hello Abp,

I've tried to run your KeycloakDemo solution and I've successfully logged in by using the web client, but there is no swagger client implementation. I've tried to implement the swagger client on Keycloak by copying the 'myclient' client. I've faced the CORS error while trying to log in by using the swagger client. Here is the steps that I followed:

  • Create a client called KeycloakDemo_Swagger
  • Give the appropriate URL's for the client
  • Set the access type property as confidential to use the client secret and client id
  • Add a client scope which is the audience and map it with the client
  • I've written the swagger implementation in KeycloakDemoHttpApiHostModule like that
  • I can see that the OAuth modal is opened and navigate the regarding client successfully
  • After logging in with the user, I see that there is a CORS error

I haven't found the solution yet and I want to ask you about what could be caused this problem. Besides that, It would be very helpful, If you implemented it in the example solution. In the near future, we may use the keycloak as an identity provider. Adding the keycloak completely working in the sample solution would provide a perfect way for the users whom want to change the IdentityServer to Keycloak.

  • ABP Framework version: v6.0.0rc-2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

2 Answer(s)
  • User Avatar
    1
    uyarbtrlp created

    any suggestions? any thoughts? any ideas?

  • User Avatar
    -3
    gterdem created
    Senior .NET Developer

    Try adding * to the WebOrigin of your realm in keycloak configuration. Or restrict it with your swagger endpoint.

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