Skip to content

Commit dab4a6f

Browse files
authored
Explaining why the offline access is required
1 parent 9917b9e commit dab4a6f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Microsoft.Identity.Web/StartupHelpers.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ public static IServiceCollection AddMsal(this IServiceCollection services, IEnum
112112
{
113113
// Response type
114114
options.ResponseType = OpenIdConnectResponseType.CodeIdToken;
115+
116+
// This scope is needed to get a refresh token when users sign-in with their Microsoft personal accounts
117+
// (it's required by MSAL.NET and automatically provided when users sign-in with work or school accounts)
115118
options.Scope.Add(OidcConstants.ScopeOfflineAccess);
116119
if (initialScopes != null)
117120
{
@@ -145,4 +148,4 @@ public static IServiceCollection AddMsal(this IServiceCollection services, IEnum
145148
return services;
146149
}
147150
}
148-
}
151+
}

0 commit comments

Comments
 (0)