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.


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.

  • 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);

  • User Avatar
    0
    mgurer created

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

  • 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)); });

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi @mgurer

    request.AddParameter("scope", "ProductService offline_access");
    
  • User Avatar
    0
    mgurer created

    Thanks, once more. You saved the day again.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38