Hi There,
I've created an app with swagger service using OAuth and it appears the service is calling a controller that isn't generated. There is no controller generated with the path: api/oauth/pay-flex/token
private async Task GetToken()
{
if (oauthResponse != null && oauthResponse.ExpiresAt > DateTime.UtcNow)
{
return oauthResponse;
}
var request = new HttpRequestMessage(HttpMethod.Post, "api/oauth/pay-flex/token");
request.SetBrowserRequestCredentials(BrowserRequestCredentials.Include);
var response = await server.SendAsync(request);
if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized)
{
navigationManager.NavigateTo($"api/oauth/pay-flex/authorize?redirectUrl={navigationManager.Uri}", true);
}
else
{
oauthResponse = await response.Content.ReadFromJsonAsync<OAuthResponse>();
if (!oauthResponse.IsSuccess)
{
throw new Exception($"Unable to get token: {oauthResponse.Error}");
}
}
return oauthResponse;
}
I noticed when I create a Rest API with OAuth, it creates a controller.
PS - how do I get Professional badge on here as a Studio subscriber?
Thanks in advance.