You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for an optional login and document level access control system. (Azure-Samples#624)
* conditional login button
* fixing conditional login button
* updating frontend
* snapshot: OBO flow works
* auth login working e2e
* cannot use env vars from frontend
* add adls gen2 setup
* more changes to prepdocs
* fix auth + streaming
* fixing up scripts
* add view action to manageacl
* Writing documentation
* doc WIP
* push auth config from server to client
* updating docs, some minor code edits to be consistent
* checkpoint
* manual setup only for now
* remove manual logging
* remove optional print
* typo
* hosting on localhost for redirect uri
* remove ms graph sdk
* run black, ruff
* dependency injection for AuthenticationHelper
* encrypted token cache
* more feedback
* more feedback, port adlsgen2 to python
* ruff, black
* ruff, black don't change files i didn't write
* fix manage acl script
* update start to support codespaces
* run black
* manual test, github codespaces localhost still works
* fixing prepdocs after manual test of azd up without auth
* adding sh files; fixing script errors
* debugging auth on codespaces
* running through setup instructions
* note about consent
* change default scope
* switch to unordered list
* missing note
* addressing feedback...
* more feedback around
* doc strings
* formatting
* feedback on group claims
* switch to transitivememberof
* readme feedback
* refactor approach to use common filtering method
* more feedback
* refactoring
* writing tests
* tests
* test adls gen2 prepdocs
* fixing tests using env vars; adding adls gen2 tests
* broken?
* fixing tests
* more tests
* fixing CI errors
* feedback
* fix script
* fix script
* fix script
* bicep deployment; add documentation for troubleshooting
* lowercase true for env comparison
* feedback
* fix sh syntax errors
* fixing syntax errors
* Script fixes
---------
Co-authored-by: Matt Gotteiner <magottei@microsoft.com>
-[Enabling login and document level access control](#enabling-login-and-document-level-access-control)
20
21
-[Using the app](#using-the-app)
21
22
-[Running locally](#running-locally)
22
23
-[Productionizing](#productionizing)
@@ -215,6 +216,10 @@ By default, the deployed Azure web app will have no authentication or access res
215
216
216
217
To then limit access to a specific set of users or groups, you can follow the steps from [Restrict your Azure AD app to a set of users](https://learn.microsoft.com/azure/active-directory/develop/howto-restrict-your-app-to-a-set-of-users) by changing "Assignment Required?" option under the Enterprise Application, and then assigning users/groups access. Users not granted explicit access will receive the error message -AADSTS50105: Your administrator has configured the application <app_name> to block users unless they are specifically granted ('assigned') access to the application.-
217
218
219
+
### Enabling login and document level access control
220
+
221
+
By default, the deployed Azure web app allows users to chat with all your indexed data. You can enable an optional login system using Azure Active Directory to restrict access to indexed data based on the logged in user. Enable the optional login and document level access control system by following [this guide](./LoginAndAclSetup.md).
222
+
218
223
## Running locally
219
224
220
225
You can only run locally **after** having successfully run the `azd up` command. If you haven't yet, follow the steps in [Azure deployment](#azure-deployment) above.
# Empty page is recommended for login redirect to work.
52
+
# See https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/initialization.md#redirecturi-considerations for more information
53
+
@bp.route("/redirect")
54
+
asyncdefredirect():
55
+
return""
56
+
57
+
48
58
@bp.route("/favicon.ico")
49
59
asyncdeffavicon():
50
60
returnawaitbp.send_static_file("favicon.ico")
@@ -78,6 +88,8 @@ async def ask():
78
88
ifnotrequest.is_json:
79
89
returnjsonify({"error": "request must be json"}), 415
# If you encounter a blocking error during a DefaultAzureCredential resolution, you can exclude the problematic credential by using a parameter (ex. exclude_shared_token_cache_credential=True)
# Model does not handle lengthy system messages well.
199
-
# Moved sources to latest user conversation to solve follow up questions prompt.
200
202
history[-1]["user"] +"\n\nSources:\n"+content,
201
-
max_tokens=self.chatgpt_token_limit,
203
+
max_tokens=self.chatgpt_token_limit,# Model does not handle lengthy system messages well. Moving sources to latest user conversation to solve follow up questions prompt.
# Add examples to show the chat what responses we want.
251
-
# It will try to mimic any responses and make sure they match the rules laid out in the system message.
258
+
# Add examples to show the chat what responses we want. It will try to mimic any responses and make sure they match the rules laid out in the system message.
0 commit comments