Open Closed

Swagger authorization error #7051


User avatar
0
Repunjay_TASC created

Need help configuring swagger authorization. can't get past the following error.

error:invalid_request error_description:The specified 'redirect_uri' is not valid for this client application. error_uri:https://documentation.openiddict.com/errors/ID2043

for your refence i have attached swagger url and table screen shots

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

57 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please sahre the logs of authserver. Thanks

    liming.ma@volosoft.com

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Repunjay_TASC created

    It has been sent. Thank you

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The redirect URL in the request does not match the value in the database.

    https://localhost:44318/swagger/oauth2-redirect.html https://localhost:44343/swagger/oauth2-redirect.html

    Client validation failed because 'https://localhost:44343/swagger/oauth2-redirect.html' was not a valid redirect_uri for Files_App.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Repunjay_TASC created

    Can you please guid, where I miss configuration? Also please find above table screenshot "Redirecturi " and "Clienturi" column value is correct?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please update the correct URL in the database and then clear the cache(redis).

    change https://localhost:44318 to https://localhost:44343

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Repunjay_TASC created

    Hi ,

    1. I have updated same port in DB now **redirect_uri ** error got resolved.

    However, While I am click on below "Authorize" button, I am getting below error, what could be the issue for this?

    error :-

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share the data in the database again.

    Thanks.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Repunjay_TASC created

    1.The above error was fixed because I used "Files_App" instead of "Files_Swagger" for the swagger application. however, modified the database "ClientId"  column values to "Files_Swagger".

    However, I'm still having issues.

    DBMigrator appsetting.json database

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can try to remove the client secret for the swagger application.

    Swagger is a public application. https://auth0.com/docs/get-started/applications/confidential-and-public-applications

    https://github.com/abpframework/abp/blob/dev/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json#L38-L41

    https://github.com/abpframework/abp/blob/dev/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/OpenIddict/OpenIddictDataSeedContributor.cs#L188-L198

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Repunjay_TASC created

    Hi

    1. As per your suggestion i have removed ** client secret** for the **swagger ** application. able to authorizations.

    2. However, I want to login using angular application i have done below steps but facing **invalid_scope **error. error:invalid_scope error_description:The specified 'scope' is invalid.

    Database :-

    appsetting.json

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    error_description:The specified 'scope' is invalid.

    Please share the logs.txt and Permissions of your clients

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Repunjay_TASC created

    It has been sent. Thank you

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The authentication request was rejected because invalid scopes were specified: ["Files"].

    "client_id": "Files_App",

    Please check the scopes of Files_App

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Repunjay_TASC created

    Can you pls guide me where i miss configuration or what are configuration need to cross check ?

    FilesAuthServerModule.cs

    Appsettings.json

    FilesHttpApiHostModule.cs

    Angular

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please check the OpenIddictDataSeedContributor file

    await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor {
                    Name = "Files", DisplayName = "Files API", Resources = { "Files" }
                });
    

    https://github.com/abpframework/abp/blob/dev/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/OpenIddict/OpenIddictDataSeedContributor.cs#L59-L67

    You can also try to clear the cache(redis).

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Repunjay_TASC created

    This code already present

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share a simple project? liming.ma@volosoft.com

    I will check it locally.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Repunjay_TASC created

    It has been sent. Thank you

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Repunjay_TASC created

    Is there an alternative option for sharing the project with you, as emails don't seem to be delivered?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can share project via https://wetransfer.com/

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Thanks. I will download and test it.

    btw, can you share some steps about your project?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Repunjay_TASC created

    This is a sample project. I'm currently conducting a proof of concept (POC) for a File Management module. However, I want to run and test the File Management module locally. To do this, I simply ran ABP Suite locally and added the File Management module. Then, I tried to run the project as per the guidelines provided by ABP.IO .

    I haven't configured any steps from my side this project.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    How can I get the The authentication request was rejected because invalid scopes were specified: ["Files"]. via your sample project?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Repunjay_TASC created

    You can login using angular application then you will get this error, However, i shared below two tables data via email.

    "OpenIddictApplications" "OpenIddictScopes"

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    ok, I will give it a try. Thanks.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.