OAuth 2.0 - Not getting refresh token

Himanshu Joshi 0 Reputation points
2024-11-26T05:04:22.91+00:00

image

Hello,

I am using OAuth 2.0 for authorization and using msal-node package I successfully got an access token in response but did not get a refresh token I am using User.Read scope to get access token

Microsoft Teams | Development
Microsoft Teams | Development
Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
{count} votes

1 answer

Sort by: Most helpful
  1. Nivedipa-MSFT 3,946 Reputation points Microsoft External Staff Moderator
    2024-12-05T08:54:10.5+00:00

    To obtain a refresh token, you need to include the offline_access scope in your authorisation request. This scope is specifically designed to request a refresh token, which allows your application to maintain access to resources without requiring the user to re-authenticate User's image

    Ref Doc: https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow#refreshing-the-access-tokens

    Thanks, 

    Nivedipa

    ************************************************************************* 

    You can share your feedback via Microsoft Teams Developer Feedback link. Click hereto escalate. 

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.