Open Closed

Not able to Authenticate through Swagger #1896



3 Answer(s)
  • User Avatar
    1
    gterdem created
    Senior .NET Developer

    2021-09-24 14:29:24.431 +00:00 [ERR] Invalid redirect_uri: https://fwateer.azurewebsites.net/swagger/oauth2-redirect.html

    {"ClientId":"eInvoicing_Swagger","ClientName":"eInvoicing_Swagger","RedirectUri":null,"AllowedRedirectUris": ["https://localhost:44318/swagger/oauth2-redirect.html"]

    Apparently you have the dev environment redirect uri (https://localhost:44318/swagger/oauth2-redirect.html) and missing production redirect uri (https://fwateer.azurewebsites.net/swagger/oauth2-redirect.html) for the swagger client.

    Check your database (or from identity server UI) that your client with eInvoicing_Swagger ID has https://fwateer.azurewebsites.net/swagger/oauth2-redirect.html redirect Uri.

  • User Avatar
    0
    mhassanin created

    Thanks a lot for the quick response, I did insert a record in IdentityServerClientRedirectUris table withthe requiered info and it works,
    Is this is the right way to do it, I mean inserting a row in the table? or there a UI for the API.HOST porject to mange this?

    Thanks
    Mohamed Hassanin

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Use IdentityServer Management:

    Navigate to Administration ->Identity Server -> Clients
    image.png
    Under Actions button, Edit -> Application Urls -> Callback
    image.png

    Use DbMigrator with Different Environment

    Create an other environment like appsettings.staging.json that has staging client root url (Swagger:RootUrl or App:RootUrl) in the appsettings. When you set the environment and run the DbMigrator, it will add the staging data from the appsettings.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 25, 2025, 11:10