Giter Site home page Giter Site logo

Comments (7)

alliscode avatar alliscode commented on July 3, 2024

Hi @tdebiasio, thank you for creating this issue. We are in the process of moving Copilot Chat to its own repo located here:
https://github.com/microsoft/chat-copilot

I'm transferring this issue to that repo where we will take a look :).

from chat-copilot.

glahaye avatar glahaye commented on July 3, 2024

Hi @tdebiasio

AAD can be a pain to setup. Let's start by verifying the info in your .env file.

Does it look something like this:

REACT_APP_BACKEND_URI=https://localhost:40443/
REACT_APP_AAD_AUTHORITY=https://login.microsoftonline.com/YOUR_TENANT_ID
REACT_APP_AAD_CLIENT_ID=YOUR_CLIENT_ID

Where YOUR_TENANT_ID is your AAD tenant's GUID and YOUR_CLIENT_ID is your frontend client ID's GUID?

from chat-copilot.

tdebiasio avatar tdebiasio commented on July 3, 2024

@glahaye, that's correct and for the appsettings.json I have the following using the same tenant and client IDs as in the .env file:

  "Authorization": {
    "Type": "AzureAd",
    "ApiKey": "",
    "AzureAd": {
      "Instance": "https://login.microsoftonline.com/",
      "TenantId": "TENANT_ID",
      "ClientId": "CLIENT_ID",
      "Scopes": "access_as_user"
    }
  },

from chat-copilot.

glahaye avatar glahaye commented on July 3, 2024

I think that's your problem right there!

You need TWO distinct app registrations: one for your frontend and one for your backend.

I was trying to find where in the documentation we mention that but it seems it's never been in there!

I've created #54 to address this.

I should get around to work on the documentation this week. In the meantime, create a second app registration for the backend. It doesn't need any redirect URL's.

Here's some more info before I get around to writing the documentation:
https://damienbod.com/2020/06/08/angular-spa-with-an-asp-net-core-api-using-azure-ad-auth-and-user-access-tokens/
https://stackoverflow.com/questions/73047805/setup-spa-frontend-and-backend-as-separate-azure-ad-app-registrations

from chat-copilot.

glahaye avatar glahaye commented on July 3, 2024

@tdebiasio Have a look at the following PR. It gives you all the steps you need to make Azure AD Auth work:
#66

If this fixes your problem, please close this issue!

from chat-copilot.

glahaye avatar glahaye commented on July 3, 2024

The PR is now merged. All steps required to properly set up AAD are detailed.

from chat-copilot.

glahaye avatar glahaye commented on July 3, 2024

Furthermore, the client now has all the elements needed to support AAD correctly.

Solution verified to work.

Closing this issue.

Don't hesitate to reply if more information is required.

from chat-copilot.

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.