Swagger OAuth Controller missing

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.

Hi @joshbooker,

I couldn't reproduce such an error. A controller should be generated and look something like this:

I've tired twice with a new app. Can I email you my swagger?

Sure. You can send us the entire app. However the total attachment size must be less than 5MB otherwise it won't make it through. Alternatively you can upload the app somewhere (OneDrive, Google drive etc).

It worked after updating from 1.19 to 1.24. Thanks.