Giter Club home page Giter Club logo

Comments (6)

pamelafox avatar pamelafox commented on June 2, 2024

Hm, our fetching code is slightly different:

export async function configApi(): Promise<Config> {
    const response = await fetch(`${BACKEND_URI}/config`, {
        method: "GET"
    });

    return (await response.json()) as Config;
}

versus

async function fetchAuthSetup(): Promise<AuthSetup> {
    const response = await fetch("/auth_setup");
    if (!response.ok) {
        throw new Error(`auth setup response was not ok: ${response.status}`);
    }
    return await response.json();
}

So I wonder if BACKEND_URI is confusing it. What do you see in the network requests of your browser for that request? You could try changing that fetch to just "/config", if you dont have any need to override BACKEND_URI.

from azure-search-openai-demo.

Caden-Ertel avatar Caden-Ertel commented on June 2, 2024

Switching to just /config still results in a 403.

I guess something else to note is that the .auth/me and .auth/refresh don't resolve either, which might another factor in this issue?

is there a reason why the config api request needs to have token sent in authorization headers?

Also, is there a place where you can see the logs that is outputted from the gunicorn server? as opposed to just the app service logs

from azure-search-openai-demo.

pamelafox avatar pamelafox commented on June 2, 2024

If .auth* routes are not working, then your App Service built-in authentication is not set up properly. A correct setup looks like this in the Portal:

Screenshot 2024-05-07 at 1 53 05 PM

But I don't think we've made it a strict requirement that App Service built-in auth must be setup, since we also use the MSAL SDKs to handle authentication. Do you perhaps have a partially setup built-in auth that's messing with stuff? Do you see anything on that authentication page?

I have tips here for viewing App Service logs:
https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/docs/appservice.md
I usually download them. You may need to increase your log level to see more logs, since it defaults to WARNING level in production.

from azure-search-openai-demo.

Caden-Ertel avatar Caden-Ertel commented on June 2, 2024

My auth settings page is identical to yours...

HOWEVER,

Seeing the difference in code you posted versus what version of the repo we had was an issue:

Yours:

export async function configApi(): Promise<Config> {
    const response = await fetch(`${BACKEND_URI}/config`, {
        method: "GET"
    });

    return (await response.json()) as Config;
}

Ours:

export async function configApi(idToken: string | undefined): Promise<Config> {
    const response = await fetch("/config", {
        method: "GET",
        headers: getHeaders(idToken)
    });

    return (await response.json()) as Config;
}

Ill probably need to pull the latest version and then see if those issues still persist, at least on first test, the new version of the code fixed the 403 issue with config

from azure-search-openai-demo.

pamelafox avatar pamelafox commented on June 2, 2024

Ah, yes, I removed getHeaders as I realized the backend wasn't using it. Glad it's working better.

from azure-search-openai-demo.

Caden-Ertel avatar Caden-Ertel commented on June 2, 2024

Ok, I'm still seeing 403 errors accessing /chat, even though the same auth method is working for a local development

not seeing any exceptions in Azure Monitor, nor is anything showing up in App Service Logs with the logging level set to INFO

from azure-search-openai-demo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.