sample-app-aoai-chatGPT icon indicating copy to clipboard operation
sample-app-aoai-chatGPT copied to clipboard

Allow disabling identity provider requirement with an environment variable

Open matsfinsas opened this issue 2 years ago • 1 comments

Disabling identity provider authentication through an environment variable would be a great quality of life improvement.

Doing it manually in the code itself is easy, but also seems to require a bunch of additional steps to set up a new pipeline, hosting a new Docker image or manually getting the code onto an Azure Web App.

matsfinsas avatar Jun 21 '23 12:06 matsfinsas

Disabling identity provider authentication through an environment variable would be a great quality of life improvement.

Doing it manually in the code itself is easy, but also seems to require a bunch of additional steps to set up a new pipeline, hosting a new Docker image or manually getting the code onto an Azure Web App.

Where did you manage to disable the IDP? I'm trying to run in a devcontainer but I am hit with the Authentication error when trying to run via start.sh. This is after populating the .env as completely as possible.

EDIT: I think I found it in Chat.tsx:

    const getUserInfoList = async () => {
        const userInfoList = await getUserInfo();
        if (userInfoList.length === 0 && window.location.hostname !== "127.0.0.1") {
            setShowAuthMessage(true);
        }
        else {
            setShowAuthMessage(false);
        }
    }

I think my issue was that I was being accessed via localhost instead of 127.0.0.1 and then looking for the .auth/me stuff.

I agree making it environment driven regardless of local hostname would be nice.

entmike avatar Jun 21 '23 23:06 entmike

@entmike @Xtrah Hi all, can I please ask how did you disabled the identity provider authentication requirements? just by converting "localhost" into "127.0.0.1"? because for me didn't work. I appreciate your help. Best

Mshz2 avatar Jul 27 '23 18:07 Mshz2

@Mshz2 this is what I did when I created the issue a month back: https://github.com/Xtrah/sample-app-aoai-chatGPT/commit/3981666ca802c55b161c6df49e3e2d39e95d3b4f

Be aware that the above fork is a few commits behind this repository now, so the code might have changed.

matsfinsas avatar Jul 28 '23 10:07 matsfinsas

@Mshz2 this is what I did when I created the issue a month back: https://github.com/Xtrah/sample-app-aoai-chatGPT/commit/3981666ca802c55b161c6df49e3e2d39e95d3b4f

Be aware that the above fork is a few commits behind this repository now, so the code might have changed.

@Xtrah The link seems to be unavailable now! Could you please guide us through all the changes you made to disable the IDP. I am still being redirected to Microsoft login page.

Addressed in 436

iseabock avatar Jan 29 '24 21:01 iseabock