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
Copy file name to clipboardExpand all lines: README.rst
+69Lines changed: 69 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,75 @@ The following example demonstrates the verification of an ID token signed with t
104
104
105
105
If the token verification fails, a ``TokenValidationError`` will be raised. In that scenario, the ID token should be deemed invalid and its contents should not be trusted.
106
106
107
+
===========================
108
+
Organizations (Closed Beta)
109
+
===========================
110
+
111
+
Organizations is a set of features that provide better support for developers who build and maintain SaaS and Business-to-Business (B2B) applications.
112
+
113
+
Using Organizations, you can:
114
+
* Represent teams, business customers, partner companies, orany logical grouping of users that should have different ways of accessing your applications, as organizations.
115
+
* Manage their membership in a variety of ways, including user invitation.
116
+
* Configure branded, federated login flows for each organization.
117
+
* Implement role-based access control, such that users can have different roles when authenticating in the context of different organizations.
118
+
* Build administration capabilities into your products, using Organizations APIs, so that those businesses can manage their own organizations.
119
+
120
+
Note that Organizations is currently only available to customers on our Enterprise and Startup subscription plans.
121
+
122
+
-------------------------
123
+
Log in to an organization
124
+
-------------------------
125
+
126
+
Log in to an organization by specifying the ``organization``property when calling ``authorize()``:
127
+
128
+
.. code-block:: python
129
+
130
+
from auth0.v3.authentication.authorize_client import AuthorizeClient
131
+
132
+
client= AuthorizeClient('my.domain.com')
133
+
134
+
client.authorize(client_id='client_id',
135
+
redirect_uri='http://localhost',
136
+
organization="org_abc")
137
+
138
+
When logging into an organization, it is important to ensure the ``org_id`` claim of the ID Token matches the expected organization value. The ``TokenVerifier`` can be be used to ensure the ID Token contains the expected ``org_id`` claim value:
139
+
140
+
.. code-block:: python
141
+
142
+
from auth0.v3.authentication.token_verifier import TokenVerifier, AsymmetricSignatureVerifier
# pass the expected organization the user logged in to:
157
+
tv.verify(id_token, organization='org_abc')
158
+
159
+
-----------------------
160
+
Accept user invitations
161
+
-----------------------
162
+
163
+
Accept a user invitation by specifying the ``invitation``property when calling ``authorize()``. Note that you must also specify the ``organization``if providing an ``invitation``.
164
+
The ID of the invitation and organization are available as query parameters on the invitation URL, e.g., ``https://your-domain.auth0.com/login?invitation=invitation_id&organization=org_id&organization_name=org_name``
165
+
166
+
.. code-block:: python
167
+
168
+
from auth0.v3.authentication.authorize_client import AuthorizeClient
self.assert_fails_with_error(token, "Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time ({}) is after last auth at ({})".format(mocked_clock, expected_auth_time), max_age=max_age, clock=mocked_clock)
self.assert_fails_with_error(token, "Organization (org_id) claim must be a string present in the ID token", signature_verifier=SymmetricSignatureVerifier(HMAC_SHARED_SECRET), organization='org_123')
self.assert_fails_with_error(token, "Organization (org_id) claim must be a string present in the ID token", signature_verifier=SymmetricSignatureVerifier(HMAC_SHARED_SECRET), organization='org_123')
self.assert_fails_with_error(token, 'Organization (org_id) claim mismatch in the ID token; expected "org_abc", found "org_123"', signature_verifier=SymmetricSignatureVerifier(HMAC_SHARED_SECRET), organization='org_abc')
0 commit comments