Hello @Nandan Hegde and thanks for reaching out. Azure AD access tokens expiration cannot be set to 6 months. As stated by @Cristian SPIRIDON , it's set by default to something between 60 and 90 min. The default lifetime also varies depending on the client application requesting the token or if conditional access is enabled in the tenant. Currently, Exchange, Teams, and SharePoint Online can benefit from Continuous Access Evaluation (CAE) where long lived token expiration ranges from 20 to 28 hours.
On the other hand, Azure AD refresh tokens live up to 90 days. You can use obtain a new access token without re-entering credentials a seconding during the lifetime of a refresh token using the MSAL.PS Get-MsalToken cmdlet (Samples here) with the -Silent parameter:
Get-MsalToken -Silent # Other params
Let us know if you need additional assistance. If the answer was helpful, please accept it and complete the quality survey so that others can find a solution.