auth0-ai-langchain 1.0.0b1__py3-none-any.whl → 1.0.0b3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of auth0-ai-langchain might be problematic. Click here for more details.

@@ -44,7 +44,7 @@ class Auth0AI:
44
44
  auth0_ai = Auth0AI()
45
45
 
46
46
  with_async_user_confirmation = auth0_ai.with_async_user_confirmation(
47
- scope="stock:trade",
47
+ scopes=["stock:trade"],
48
48
  audience=os.getenv("AUDIENCE"),
49
49
  binding_message=lambda ticker, qty: f"Authorize the purchase of {qty} {ticker}",
50
50
  user_id=lambda *_, **__: ensure_config().get("configurable", {}).get("user_id")
@@ -108,5 +108,6 @@ class Auth0AI:
108
108
  )
109
109
  ```
110
110
  """
111
- authorizer = FederatedConnectionAuthorizer(FederatedConnectionAuthorizerParams(**params), self.auth0)
111
+ authorizer = FederatedConnectionAuthorizer(
112
+ FederatedConnectionAuthorizerParams(**params), self.auth0)
112
113
  return authorizer.authorizer()
@@ -3,5 +3,8 @@ from auth0_ai.interrupts.federated_connection_interrupt import (
3
3
  FederatedConnectionInterrupt as FederatedConnectionInterrupt
4
4
  )
5
5
 
6
- from auth0_ai.authorizers.federated_connection_authorizer import get_credentials_for_connection as get_credentials_for_connection
6
+ from auth0_ai.authorizers.federated_connection_authorizer import (
7
+ get_credentials_for_connection as get_credentials_for_connection,
8
+ get_access_token_for_connection as get_access_token_for_connection
9
+ )
7
10
  from .federated_connection_authorizer import FederatedConnectionAuthorizer as FederatedConnectionAuthorizer
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: auth0-ai-langchain
3
- Version: 1.0.0b1
3
+ Version: 1.0.0b3
4
4
  Summary: This package is an SDK for building secure AI-powered applications using Auth0, Okta FGA and LangChain.
5
5
  License: Apache-2.0
6
6
  Author: Auth0
@@ -11,12 +11,12 @@ Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
13
  Classifier: Programming Language :: Python :: 3.13
14
- Requires-Dist: auth0-ai (>=1.0.0b1,<2.0.0)
15
- Requires-Dist: langchain (>=0.3.25,<0.4.0)
16
- Requires-Dist: langchain-core (>=0.3.59,<0.4.0)
17
- Requires-Dist: langgraph (>=0.4.3,<0.5.0)
18
- Requires-Dist: langgraph-sdk (>=0.1.66,<0.2.0)
19
- Requires-Dist: openfga-sdk (>=0.9.4,<0.10.0)
14
+ Requires-Dist: auth0-ai (>=1.0.0b3,<2.0.0)
15
+ Requires-Dist: langchain (>=0.3.26,<0.4.0)
16
+ Requires-Dist: langchain-core (>=0.3.69,<0.4.0)
17
+ Requires-Dist: langgraph (>=0.5.3,<0.6.0)
18
+ Requires-Dist: langgraph-sdk (>=0.1.73,<0.2.0)
19
+ Requires-Dist: openfga-sdk (>=0.9.5,<0.10.0)
20
20
  Project-URL: Homepage, https://auth0.com
21
21
  Description-Content-Type: text/markdown
22
22
 
@@ -52,7 +52,7 @@ from langchain_core.tools import StructuredTool
52
52
  auth0_ai = Auth0AI()
53
53
 
54
54
  with_async_user_confirmation = auth0_ai.with_async_user_confirmation(
55
- scope="stock:trade",
55
+ scopes=["stock:trade"],
56
56
  audience=os.getenv("AUDIENCE"),
57
57
  binding_message=lambda ticker, qty: f"Authorize the purchase of {qty} {ticker}",
58
58
  user_id=lambda *_, **__: ensure_config().get("configurable", {}).get("user_id"),
@@ -80,6 +80,36 @@ trade_tool = with_async_user_confirmation(
80
80
 
81
81
  2. Handle interruptions properly. For example, if user is not enrolled to MFA, it will throw an interruption. See [Handling Interrupts](#handling-interrupts) section.
82
82
 
83
+ ### CIBA with RAR (Rich Authorization Requests)
84
+ `Auth0AI` supports RAR (Rich Authorization Requests) for CIBA. This allows you to provide additional authorization parameters to be displayed during the user confirmation request.
85
+
86
+ When defining the tool authorizer, you can specify the `authorization_details` parameter to include detailed information about the authorization being requested:
87
+
88
+ ```python
89
+ with_async_user_confirmation = auth0_ai.with_async_user_confirmation(
90
+ scopes=["stock:trade"],
91
+ audience=os.getenv("AUDIENCE"),
92
+ binding_message=lambda ticker, qty: f"Authorize the purchase of {qty} {ticker}",
93
+ authorization_details=lambda ticker, qty: [
94
+ {
95
+ "type": "trade_authorization",
96
+ "qty": qty,
97
+ "ticker": ticker,
98
+ "action": "buy"
99
+ }
100
+ ],
101
+ user_id=lambda *_, **__: ensure_config().get("configurable", {}).get("user_id"),
102
+ # Optional:
103
+ # store=InMemoryStore()
104
+ )
105
+ ```
106
+
107
+ To use RAR with CIBA, you need to [set up authorization details](https://auth0.com/docs/get-started/apis/configure-rich-authorization-requests) in your Auth0 tenant. This includes defining the authorization request parameters and their types. Additionally, the [Guardian SDK](https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian) is required to handle these authorization details in your authorizer app.
108
+
109
+ For more information on setting up RAR with CIBA, refer to:
110
+ - [Configure Rich Authorization Requests (RAR)](https://auth0.com/docs/get-started/apis/configure-rich-authorization-requests)
111
+ - [User Authorization with CIBA](https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow/user-authorization-with-ciba)
112
+
83
113
  ## Authorization for Tools
84
114
 
85
115
  The `FGAAuthorizer` can leverage Okta FGA to authorize tools executions. The `FGAAuthorizer.create` function can be used to create an authorizer that checks permissions before executing the tool.
@@ -1,15 +1,15 @@
1
1
  auth0_ai_langchain/FGARetriever.py,sha256=SQwxo2aDtQhwQtYmszoKw3BH-U5QVnvPAgVw9EDzKVM,6002
2
2
  auth0_ai_langchain/__init__.py,sha256=I331Kz-q97ZU7TfXaOR5UBbJamGEJ15twbf2HP1iCHs,67
3
- auth0_ai_langchain/auth0_ai.py,sha256=J3fxYNZf0KMK2w085dCdGfCRyafQGWPAI19edcYpQi8,4732
3
+ auth0_ai_langchain/auth0_ai.py,sha256=rAHvGBBvPgMXhnmEySmNMp6cbrXrZk3c3cn9r0psfZc,4748
4
4
  auth0_ai_langchain/ciba/__init__.py,sha256=X62HZB20XdhsgcaKld6rLm2BOSuiO5uU5v7ePQz27Mk,268
5
5
  auth0_ai_langchain/ciba/ciba_authorizer.py,sha256=GRAB3NBnmoxAECrRjPNdA9N9uQ4pCEzP6dF8RUwlysM,766
6
6
  auth0_ai_langchain/ciba/graph_resumer.py,sha256=EpdzzB_NccdggKA3x__Q3Yziejo7AJjR4aJ57TZmYPA,5474
7
- auth0_ai_langchain/federated_connections/__init__.py,sha256=kGpPN9ntsyvE-2m_lcdCVvPevadyILCk3NiAm4TN0QA,429
7
+ auth0_ai_langchain/federated_connections/__init__.py,sha256=kHsfxMbbuYtcnubslUTVLZX2FybLlKRcoPCgYQCMIK4,509
8
8
  auth0_ai_langchain/federated_connections/federated_connection_authorizer.py,sha256=o25oRGiTo9y5mpjDNEWWaFVAIFbhwaxC0pcRId-4oYE,1405
9
9
  auth0_ai_langchain/fga/__init__.py,sha256=rgqTD4Gvz28jNdqhxTG5udbgyeUMsyvRj83fHBJdt4s,137
10
10
  auth0_ai_langchain/utils/interrupt.py,sha256=DZ1b9OAkg3SQru9mSaQGBC6UY0ODz7QSskS9RlVyEGw,860
11
11
  auth0_ai_langchain/utils/tool_wrapper.py,sha256=dHjcqykT2aohdFOm0mLZ9U6bXB6NHjfABb3aXef5174,1210
12
- auth0_ai_langchain-1.0.0b1.dist-info/LICENSE,sha256=Lu_2YH0oK8b_VVisAhNQ2WIdtwY8pSU2PLbll-y6Cj8,9792
13
- auth0_ai_langchain-1.0.0b1.dist-info/METADATA,sha256=lyc_GI9ymhgIrQh2wM2fv-lYF_uWT9VXFanst8HowEs,11790
14
- auth0_ai_langchain-1.0.0b1.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
15
- auth0_ai_langchain-1.0.0b1.dist-info/RECORD,,
12
+ auth0_ai_langchain-1.0.0b3.dist-info/LICENSE,sha256=Lu_2YH0oK8b_VVisAhNQ2WIdtwY8pSU2PLbll-y6Cj8,9792
13
+ auth0_ai_langchain-1.0.0b3.dist-info/METADATA,sha256=BAGQElZsPwaapELQicSEAUruKoXGakmBjWHQWcVoOPY,13548
14
+ auth0_ai_langchain-1.0.0b3.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
15
+ auth0_ai_langchain-1.0.0b3.dist-info/RECORD,,