Repository navigation
Security: remove API key auth - #92
Gina Triolo (gitri-ms) wants to merge 16 commits into
Conversation
|
|
||
| ## Authorization | ||
| All of endpoints (except `/healthz`) require authorization to access. | ||
| By default, an API key is required for access which can be found in the `Authorization:ApiKey` configuration setting. |
There was a problem hiding this comment.
TODO: update this section. Also update deployment commands
| [string] | ||
| # Authority for client applications that are not configured as multi-tenant. | ||
| $Authority="https://login.microsoftonline.com/common" | ||
| $Authority = "https://login.microsoftonline.com/common" |
There was a problem hiding this comment.
There is some weirdness here -- the backend expects instance + tenant ID, while the frontend expects authority. However the values need to match. This could be confusing for the user. Perhaps change to make them more consistent (e.g. both use instance + tenant id)?
There was a problem hiding this comment.
What's the format expected from the client side?
|
|
||
| [string] | ||
| # Azure AD tenant ID for authenticating users | ||
| $AzureAdTenantId = "common", |
There was a problem hiding this comment.
As discussed during bug bash, we might want to not put "common" as the default and force users to provide a tenant
There was a problem hiding this comment.
Yup, I am currently going through and changing all of these
| echo " -a, --app-service-sku WEB_APP_SVC_SKU SKU for the Azure App Service plan (default: \"B1\")" | ||
| echo " -i, --instance AZURE_AD_INSTANCE Azure AD cloud instance for authenticating users" | ||
| echo " (default: \"https://login.microsoftonline.com/\")" | ||
| echo " -t, --tenant-id AZURE_AD_TENANT_ID Azure AD tenant ID for authenticating users (default: \"common\")" |
There was a problem hiding this comment.
Again, might want to make this mandatory...
| : "${WEB_APP_SVC_SKU:="B1"}" | ||
| : "${WEB_APP_REGION:="westus2"}" | ||
| : "${AZURE_AD_INSTANCE:="https://login.microsoftonline.com/"}" | ||
| : "${AZURE_AD_TENANT_ID:="common"}" |
| param azureAdInstance string = environment().authentication.loginEndpoint | ||
|
|
||
| @description('Azure AD tenant ID for authenticating users') | ||
| param azureAdTenantId string = 'common' |
There was a problem hiding this comment.
Default again...
|
Closing this PR as it is now covered by #126 |
### Motivation and Context This PR addresses microsoft/semantic-kernel#1639. It is a combination of PRs #92 and #110 ### Description #### Backend changes - Remove API key authorization - Use "AzureAD" as default authentication configuration for deployments, "None" for running locally (Note: UI changes to disable sign in flow for the latter case are still forthcoming) - Enable auth policy on controllers that checks if the user is part of the conversation they are trying to access This PR changes the contract between the frontend and backend around how user IDs are communicated. Users who have been signing into the frontend with AAD will now only see their chats if the backend is also gated by AAD authentication, which was not the case previously. #### Frontend changes - adds `REACT_APP_AUTH_TYPE` and changes AAD variables in `.env` to be optional - adds `AuthHelper.IsAuthAAD` to conditionally render different elements throughout the app - changes user settings menu popup to instead just show as a settings button:  Existing users will need to uncomment `REACT_APP_AUTH_TYPE=AzureAd` in `webapp/.env` to continue using AAD as their authorization type. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [Contribution Guidelines](https://github.com/microsoft/copilot-chat/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/copilot-chat/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Desmond Howard <[email protected]>
### Motivation and Context This PR addresses microsoft/semantic-kernel#1639. It is a combination of PRs microsoft#92 and microsoft#110 ### Description #### Backend changes - Remove API key authorization - Use "AzureAD" as default authentication configuration for deployments, "None" for running locally (Note: UI changes to disable sign in flow for the latter case are still forthcoming) - Enable auth policy on controllers that checks if the user is part of the conversation they are trying to access This PR changes the contract between the frontend and backend around how user IDs are communicated. Users who have been signing into the frontend with AAD will now only see their chats if the backend is also gated by AAD authentication, which was not the case previously. #### Frontend changes - adds `REACT_APP_AUTH_TYPE` and changes AAD variables in `.env` to be optional - adds `AuthHelper.IsAuthAAD` to conditionally render different elements throughout the app - changes user settings menu popup to instead just show as a settings button:  Existing users will need to uncomment `REACT_APP_AUTH_TYPE=AzureAd` in `webapp/.env` to continue using AAD as their authorization type. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [Contribution Guidelines](https://github.com/microsoft/copilot-chat/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/copilot-chat/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Desmond Howard <[email protected]>
### Motivation and Context This PR addresses microsoft/semantic-kernel#1639. It is a combination of PRs microsoft#92 and microsoft#110 ### Description #### Backend changes - Remove API key authorization - Use "AzureAD" as default authentication configuration for deployments, "None" for running locally (Note: UI changes to disable sign in flow for the latter case are still forthcoming) - Enable auth policy on controllers that checks if the user is part of the conversation they are trying to access This PR changes the contract between the frontend and backend around how user IDs are communicated. Users who have been signing into the frontend with AAD will now only see their chats if the backend is also gated by AAD authentication, which was not the case previously. #### Frontend changes - adds `REACT_APP_AUTH_TYPE` and changes AAD variables in `.env` to be optional - adds `AuthHelper.IsAuthAAD` to conditionally render different elements throughout the app - changes user settings menu popup to instead just show as a settings button:  Existing users will need to uncomment `REACT_APP_AUTH_TYPE=AzureAd` in `webapp/.env` to continue using AAD as their authorization type. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [Contribution Guidelines](https://github.com/microsoft/copilot-chat/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/copilot-chat/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Desmond Howard <[email protected]>
feat [AB#53]: inject QSearchService
Motivation and Context
This PR addresses microsoft/semantic-kernel#1639
Description
Breaking change: This PR changes the contract between the frontend and backend around how user IDs are communicated. Users who have been signing into the frontend with AAD will now only see their chats if the backend is also gated by AAD authentication, which was not the case previously.
Contribution Checklist