MAUI App JwtToken Wrapper & Login Update

Замовник: AI | Опубліковано: 06.12.2025

Requirement : There is already an mobile app developed in MAUI. There are following changes to be made in it. 1. To keep it login until if a valid JwtToken is present. Currently it logs out everytime. 2. The existing logout functionality should work fine. 3. To implement JwtToken wrapper class such that it internall generates new JwtToken using RefreshToken as per details below :- 3.1 Currently, We are storing JwtToken in Call.Preferences and using the same in all API calls and passing in the header. I want to build a wrapper class such that 3.2 if JwtToken is valid then return JwtToken 3.3 if JwtToken is expired then it internally calls API with Refresh Token and get new JwtToken and then return JwtToken if internally RefreshToken is expired then redirect to Login page 3.4 Example of the code is as below class static configuration { static string JwtToken { 1. check if JwtToken is expired Call.Preferences("EipredDate"); return JwtToken 2. If the JwtToken is expired 3. Make Backend API to server using RefreshToken and get new JwtToken 4. Update Call.Preferences, JwtToken, RefreshToken, ExpiredDate 5. if (RefreshToken) is Token httpcode 401 6. Redirect to Login page return JwtToken; } } Out-of-Scope. Backend API development is out of scope. Swagger Url :- https://authmyinvoicedev.azurewebsites.net/swagger/index.html Use only API which has "api/AppAccount". These are mobile app specific APIs. DO NOT USE OTHER APIS.