Open Closed

Refresh Token in Blazor Server App #5537


User avatar
0
neethucp created

Hi,

We are trying to implement a feature where in the user role is updated when the user accepts the terms and conditions after login. After the user accepts the terms and conditions, the user will have to see additional menu items. We already have refresh token enabled for the client application but is unsure on how to refresh the token from blazor server manually and store it so that the token is used in the subsequent requests. Can you please provide some guidance on how to refresh the token in blazor server app?

  • ABP Framework version: v7.3.1
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Serve)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

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

    hi

    You can call the Challenge(new AuthenticationProperties { RedirectUri = your_returnUrl }, "oidc"); to get new access token.

    eg:

    https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs#L81

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

    Thank you so much for the response. We have a blazor server application, so we don't have access to httpcontext in razor components. So not sure on from where we have to invoke the Challenge method.

    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 add a controller or razor page to your blazor server project, and then redirect to its endpoint.

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

    That worked. Thank you so much.

    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.