@@ -22,7 +22,7 @@ generated the client ID and secret to configure your `OAuth2Middleware` with at
22223 . Set the ` redirect_uri ` of your application that you have also configured in the IDP.
23234 . Add the middleware and include the router to your application as shown in the [ integration] ( /integration/integration )
2424 section.
25- 5 . Open the ` /oauth2/{provider}/auth ` endpoint on your browser and test the authentication flow. Check out
25+ 5 . Open the ` /oauth2/{provider}/authorize ` endpoint on your browser and test the authentication flow. Check out
2626 the [ router] ( /integration/integration#router ) for the ` {provider} ` variable.
2727
2828Once the authentication is successful, the user will be redirected to the ` redirect_uri ` and the ` request.user ` will
@@ -90,8 +90,6 @@ Claims(
9090)
9191```
9292
93- ::: info NOTE
94-
9593Not all IDPs provide the ` first_name ` and the ` last_name ` attributes already joined as in the example above, or
9694the email in a list. So you are given the flexibility using transformer function to map the attributes as you want.
9795
@@ -104,14 +102,20 @@ flowchart LR
104102 Transform --> IDPUserData
105103```
106104
107- :::
108-
109105## User provisioning
110106
111107User provisioning refers to the process of creating, updating, and deleting user accounts within the OAuth2 IDP and
112108synchronizing that information with your FastAPI application's database. There are two approaches to user provisioning
113109and both require the user claims to be mapped properly for creating a new user or updating an existing one.
114110
111+ ::: info NOTE
112+
113+ In both scenarios, it is recommended to use the ` identity ` attribute for uniquely identifying the user from the
114+ database. So if the application uses or plans to use multiple IDPs, make sure to include the ` provider ` attribute when
115+ calculating the ` identity ` attribute.
116+
117+ :::
118+
115119### Automatic provisioning
116120
117121After successful authentication, you can automatically create a user in your application's database using the
@@ -125,14 +129,6 @@ approach is useful when there missing mandatory attributes in `request.user` for
125129database. You need to define a route for provisioning and provide it as ` redirect_uri ` , so
126130the [ user context] ( /integration/integration#user-context ) will be available for usage.
127131
128- ::: info NOTE
129-
130- In both scenarios, it is recommended to use the ` identity ` attribute for uniquely identifying the user from the
131- database. So if the application uses or plans to use multiple IDPs, make sure to include the ` provider ` attribute when
132- calculating the ` identity ` attribute.
133-
134- :::
135-
136132<style >
137133.info , .details {
138134 border : 0 ;
0 commit comments