Skip to content

Commit 79b66b3

Browse files
committed
chore: update docs
1 parent bf472fb commit 79b66b3

File tree

6 files changed

+26
-13
lines changed

6 files changed

+26
-13
lines changed

html/supertokens_python/constants.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ <h1 class="title">Module <code>supertokens_python.constants</code></h1>
4343
from __future__ import annotations
4444

4545
SUPPORTED_CDI_VERSIONS = [&#34;5.4&#34;]
46-
VERSION = &#34;0.31.0&#34;
46+
VERSION = &#34;0.31.1&#34;
4747
TELEMETRY = &#34;/telemetry&#34;
4848
USER_COUNT = &#34;/users/count&#34;
4949
USER_DELETE = &#34;/user/remove&#34;

html/supertokens_python/recipe/saml/api/implementation.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.saml.api.implementation
7979
acs_url = (
8080
options.app_info.api_domain.get_as_string_dangerous()
8181
+ options.app_info.api_base_path.get_as_string_dangerous()
82-
+ &#34;/saml/callback&#34;
82+
+ f&#34;/{tenant_id}/saml/callback&#34;
8383
)
8484

8585
return await options.recipe_implementation.create_login_request(
@@ -151,7 +151,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
151151
acs_url = (
152152
options.app_info.api_domain.get_as_string_dangerous()
153153
+ options.app_info.api_base_path.get_as_string_dangerous()
154-
+ &#34;/saml/callback&#34;
154+
+ f&#34;/{tenant_id}/saml/callback&#34;
155155
)
156156

157157
return await options.recipe_implementation.create_login_request(

html/supertokens_python/recipe/thirdparty/provider.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.thirdparty.provider</co
7373
self.id = id
7474
self.config = config
7575
self.provider_type: str = &#34;oauth2&#34;
76+
self.tenant_id: str = &#34;public&#34;
7677

7778
async def get_config_for_client_type(
7879
self, client_type: Optional[str], user_context: Dict[str, Any]
@@ -601,6 +602,7 @@ <h3>Methods</h3>
601602
self.id = id
602603
self.config = config
603604
self.provider_type: str = &#34;oauth2&#34;
605+
self.tenant_id: str = &#34;public&#34;
604606

605607
async def get_config_for_client_type(
606608
self, client_type: Optional[str], user_context: Dict[str, Any]

html/supertokens_python/recipe/thirdparty/providers/config_utils.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.thirdparty.providers.co
5252
from .google_workspaces import GoogleWorkspaces
5353
from .linkedin import Linkedin
5454
from .okta import Okta
55+
from .saml import SAML
5556
from .twitter import Twitter
5657
from .utils import do_get_request
5758

@@ -243,6 +244,8 @@ <h1 class="title">Module <code>supertokens_python.recipe.thirdparty.providers.co
243244
return Twitter(provider_input)
244245
if provider_input.config.third_party_id.startswith(&#34;boxy-saml&#34;):
245246
return BoxySAML(provider_input)
247+
if provider_input.config.third_party_id.startswith(&#34;saml&#34;):
248+
return SAML(provider_input)
246249

247250
return NewProvider(provider_input)
248251

html/supertokens_python/recipe/thirdparty/providers/saml.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,23 @@ <h1 class="title">Module <code>supertokens_python.recipe.thirdparty.providers.sa
6363
redirect_uri_on_provider_dashboard: str,
6464
user_context: Dict[str, Any],
6565
) -&gt; AuthorisationRedirect:
66+
from urllib.parse import urlencode
67+
6668
from supertokens_python.supertokens import Supertokens
6769

6870
st_instance = Supertokens.get_instance()
6971
app_info = st_instance.app_info
7072

73+
tenant_id = getattr(self, &#34;tenant_id&#34;, &#34;public&#34;)
74+
7175
# Build URL to the SAML recipe&#39;s login endpoint
72-
# The tenantId will be extracted from the redirect_uri_on_provider_dashboard
73-
# or we use the default path
76+
# Include tenant_id in the path so the SAML handler receives it
7477
saml_login_url = (
7578
app_info.api_domain.get_as_string_dangerous()
7679
+ app_info.api_base_path.get_as_string_dangerous()
77-
+ &#34;/saml/login&#34;
80+
+ f&#34;/{tenant_id}/saml/login&#34;
7881
)
7982

80-
from urllib.parse import urlencode
81-
8283
query_params: Dict[str, str] = {
8384
&#34;client_id&#34;: self.config.client_id,
8485
&#34;redirect_uri&#34;: redirect_uri_on_provider_dashboard,
@@ -182,22 +183,23 @@ <h2 class="section-title" id="header-classes">Classes</h2>
182183
redirect_uri_on_provider_dashboard: str,
183184
user_context: Dict[str, Any],
184185
) -&gt; AuthorisationRedirect:
186+
from urllib.parse import urlencode
187+
185188
from supertokens_python.supertokens import Supertokens
186189

187190
st_instance = Supertokens.get_instance()
188191
app_info = st_instance.app_info
189192

193+
tenant_id = getattr(self, &#34;tenant_id&#34;, &#34;public&#34;)
194+
190195
# Build URL to the SAML recipe&#39;s login endpoint
191-
# The tenantId will be extracted from the redirect_uri_on_provider_dashboard
192-
# or we use the default path
196+
# Include tenant_id in the path so the SAML handler receives it
193197
saml_login_url = (
194198
app_info.api_domain.get_as_string_dangerous()
195199
+ app_info.api_base_path.get_as_string_dangerous()
196-
+ &#34;/saml/login&#34;
200+
+ f&#34;/{tenant_id}/saml/login&#34;
197201
)
198202

199-
from urllib.parse import urlencode
200-
201203
query_params: Dict[str, str] = {
202204
&#34;client_id&#34;: self.config.client_id,
203205
&#34;redirect_uri&#34;: redirect_uri_on_provider_dashboard,

html/supertokens_python/recipe/thirdparty/recipe_implementation.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ <h1 class="title">Module <code>supertokens_python.recipe.thirdparty.recipe_imple
247247
merged_providers, third_party_id, client_type, user_context
248248
)
249249

250+
if provider is not None:
251+
provider.tenant_id = tenant_id
252+
250253
return provider</code></pre>
251254
</details>
252255
</section>
@@ -444,6 +447,9 @@ <h2 class="section-title" id="header-classes">Classes</h2>
444447
merged_providers, third_party_id, client_type, user_context
445448
)
446449

450+
if provider is not None:
451+
provider.tenant_id = tenant_id
452+
447453
return provider</code></pre>
448454
</details>
449455
<h3>Ancestors</h3>

0 commit comments

Comments
 (0)