Open Closed

v6 RC2 error authenticating from Swagger #3539


User avatar
0
scott7106 created
  • ABP Framework version: v6.0.0_rc.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

Trying to authorize from the Swagger UI is giving errors which I have not seen before. If I launch the angular project and login, I can eventually get the swagger UI to authenticate but only because I am already logged in.

This is the first error I received.

This is the second issue I encountered. Notice the windows login prompt for accessing the site. If I am already logged in via Angular, I can hit cancel on this and I have access to the authorized endpoints. However, nothing I enter in the prompted authentication works so far.


6 Answer(s)
  • User Avatar
    0
    scott7106 created

    As a follow up, I made a couple of changes to the Swagger application configuration and it now works. I am not sure why this change removed the windows authentication prompt, but the result now matches the user experience we had with identity server.

    I changed the client type to confidential and added a configuration variable to set the secret. With this in place, things now work just like they did in 5.x for me.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    It looks like you are using both basic and OAuth authentication, I don't think you can use both

  • User Avatar
    0
    scott7106 created

    @liangshiwei I am not following your answer. The default code provided in the template application exhibited the problem described above in my initial post. Are you saying that the initial application has a problem or the changes I highlighted are a problem. Please note, it was not working until I made the changes I highlighted. It is working as expected after those changes.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    I will check it out.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Could you share the steps to reproduce? thanks.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    After my check, you don't need to type the secret on the swagger UI.

    Because the swagger client type is public. this is designed by Openiddict.

    Of course, you can change it just like you did if you want use the client secret,

Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35