I am trying to get MicrosoftGraphProvider to work with my organization. I have installed the mvcauth project template, changed the oauth settings in appsettings after creating the application and after I click the Sign In with Microsoft button I get a 401 Unauthorized error. I have set SameSiteCookies to null, true and false and it doesn’t seem to have any effect as well.
https://localhost:5001/auth/microsoftgraph
Message
Response status code does not indicate success: 401 (Unauthorized).
Stack Trace
[Authenticate: 7/22/2022 7:05:58 PM]: [REQUEST: {provider:microsoftgraph,state:5uLhIbCEbE2rFXsyXrPy}] System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized). at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() at ServiceStack.HttpUtils.SendStringToUrlAsync(HttpClient client, String url, String method, String requestBody, String contentType, String accept, Action
1 requestFilter, Action1 responseFilter, CancellationToken token) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack.Text/src/ServiceStack.Text/HttpUtils.HttpClient.cs:line 551 at ServiceStack.Auth.MicrosoftGraphAuthProvider.GetAccessTokenJsonAsync(String code, AuthContext ctx, CancellationToken token) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack/Auth/MicrosoftGraphAuthProvider.cs:line 94 at ServiceStack.Auth.OAuth2Provider.AuthenticateAsync(IServiceBase authService, IAuthSession session, Authenticate request, CancellationToken token) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack/Auth/OAuth2Provider.cs:line 124 at ServiceStack.Auth.AuthenticateService.AuthenticateAsync(Authenticate request, String provider, IAuthSession session, IAuthProvider oAuthConfig, CancellationToken token) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack/Auth/AuthenticateService.cs:line 482 at ServiceStack.Auth.AuthenticateService.PostAsync(Authenticate request) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack/Auth/AuthenticateService.cs:line 286 at ServiceStack.Host.ServiceRunner
1.ExecuteAsync(IRequest req, Object instance, TRequest requestDto) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack/Host/ServiceRunner.cs:line 155`