You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- List<string> scopes = ["{APP ID URI}/Weather.Get"];
660
+
- var accessToken = await tokenAcquisition.GetAccessTokenForUserAsync(scopes);
661
+
+ var configuration = transformContext.HttpContext.RequestServices.GetRequiredService<IConfiguration>();
662
+
+ var scopes = configuration.GetSection("DownstreamApi:Scopes").Get<IEnumerable<string>>();
663
+
+ var accessToken = await tokenAcquisition.GetAccessTokenForUserAsync(scopes ??
664
+
+ throw new InvalidOperationException("No downstream API scopes!"));
665
+
```
666
+
645
667
> [!NOTE]
646
668
> Production apps should use a production distributed token cache provider. Otherwise, the app may have poor performance in some scenarios. For more information, see the [Use a production distributed token cache provider](#use-a-production-distributed-token-cache-provider) section.
0 commit comments