Open Closed

refresh_token flow - opendiddict #3939


User avatar
0
mgurer created
  • ABP Framework version: v6.0.0
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hi. I used to get access_token and refresh_token during password flow of identityserver4. I migrated app to use openiddict and defined an openiddict application(client) with password and resresh_token flows enabled.

When I try the password flow using the related application(client) and admin user, I get only access_token. Refresh token is missing.

Can you help me for that?

Thanks.

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

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

    When I try the password flow using the related application(client) and admin user, I get only access_token. Refresh token is missing.

    Please share your http request info.

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

    var client = new RestClient("https://localhost:44322/connect/token"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/x-www-form-urlencoded"); request.AddParameter("client_id", "DemoApplicationClient"); request.AddParameter("client_secret", "1q2w3e*"); request.AddParameter("grant_type", "password"); request.AddParameter("username", "admin"); request.AddParameter("password", "1q2w3E*"); request.AddParameter("scope", "ProductService"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);

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

    DemoApplicationClient is created using blazor app UI and client_credentials,refresh_token,password flow options checked.

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

    I tried to change the token expiry time span but still its 3598.

    How change change so that client don't have to request every hour ? perhaps every 48 hours ?

    PreConfigure<OpenIddictServerBuilder>(builder => { builder.SetAccessTokenLifetime(TimeSpan.FromMinutes(720)); builder.SetIdentityTokenLifetime(TimeSpan.FromMinutes(720)); });

    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 @mgurer

    request.AddParameter("scope", "ProductService offline_access");
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    mgurer created

    Thanks, once more. You saved the day again.

    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 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.