plain.oauth 0.7.0__py3-none-any.whl → 0.7.2__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.
- plain/oauth/README.md +3 -31
- plain/oauth/default_settings.py +1 -0
- {plain_oauth-0.7.0.dist-info → plain_oauth-0.7.2.dist-info}/METADATA +4 -32
- {plain_oauth-0.7.0.dist-info → plain_oauth-0.7.2.dist-info}/RECORD +6 -5
- {plain_oauth-0.7.0.dist-info → plain_oauth-0.7.2.dist-info}/LICENSE +0 -0
- {plain_oauth-0.7.0.dist-info → plain_oauth-0.7.2.dist-info}/WHEEL +0 -0
plain/oauth/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
<!-- This file is compiled from plain-oauth/plain/oauth/README.md. Do not edit this file directly. -->
|
2
|
+
|
1
3
|
# plain.oauth
|
2
4
|
|
3
5
|
Let users log in with OAuth providers.
|
@@ -137,36 +139,6 @@ That's pretty much it!
|
|
137
139
|
|
138
140
|
## Advanced usage
|
139
141
|
|
140
|
-
### Email addresses should be unique
|
141
|
-
|
142
|
-
When you're integrating with an OAuth provider,
|
143
|
-
we think that the user's email address is the best "primary key" when linking to your `User` model in your app.
|
144
|
-
Unfortunately in Django, by default an email address is not required to be unique!
|
145
|
-
**We strongly recommend you require email addresses to be unique in your app.**
|
146
|
-
|
147
|
-
[As suggested by the Django docs](https://docs.djangoproject.com/en/4.0/topics/auth/customizing/#using-a-custom-user-model-when-starting-a-project),
|
148
|
-
one way to do this is to have your own `User` model:
|
149
|
-
|
150
|
-
```python
|
151
|
-
# In an app named "users", for example
|
152
|
-
from plain.auth.models import BaseUser
|
153
|
-
|
154
|
-
class User(BaseUser):
|
155
|
-
email = models.EmailField(unique=True)
|
156
|
-
|
157
|
-
|
158
|
-
# In settings.py
|
159
|
-
AUTH_USER_MODEL = 'users.User'
|
160
|
-
```
|
161
|
-
|
162
|
-
You'll also notice that there are no "email confirmation" or "email verification" flows in this library.
|
163
|
-
This is also intentional.
|
164
|
-
You can implement something like that yourself if you need to,
|
165
|
-
but the easier solution in our opinion is to use an OAuth provider you *trust to have done that already*.
|
166
|
-
If you look at our [provider examples](https://github.com/forgepackages/plain-oauth/tree/master/provider_examples) you'll notice how we often use provider APIs to get the email address which is "primary" and "verified" already.
|
167
|
-
If they've already done that work,
|
168
|
-
then we can just use that information.
|
169
|
-
|
170
142
|
### Handling OAuth errors
|
171
143
|
|
172
144
|
The most common error you'll run into is if an existing user clicks a login button,
|
@@ -275,7 +247,7 @@ python manage.py check --database default
|
|
275
247
|
|
276
248
|
## FAQs
|
277
249
|
|
278
|
-
### How is this different from [
|
250
|
+
### How is this different from [Django OAuth libraries](https://djangopackages.org/grids/g/oauth/)?
|
279
251
|
|
280
252
|
The short answer is that *it does less*.
|
281
253
|
|
@@ -0,0 +1 @@
|
|
1
|
+
OAUTH_LOGIN_PROVIDERS: dict
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: plain.oauth
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.2
|
4
4
|
Summary: OAuth login and API access for Plain.
|
5
5
|
Home-page: https://plainframework.com
|
6
6
|
License: BSD-3-Clause
|
@@ -21,6 +21,8 @@ Description-Content-Type: text/markdown
|
|
21
21
|
|
22
22
|
<!-- This file is compiled from plain-oauth/plain/oauth/README.md. Do not edit this file directly. -->
|
23
23
|
|
24
|
+
<!-- This file is compiled from plain-oauth/plain/oauth/README.md. Do not edit this file directly. -->
|
25
|
+
|
24
26
|
# plain.oauth
|
25
27
|
|
26
28
|
Let users log in with OAuth providers.
|
@@ -160,36 +162,6 @@ That's pretty much it!
|
|
160
162
|
|
161
163
|
## Advanced usage
|
162
164
|
|
163
|
-
### Email addresses should be unique
|
164
|
-
|
165
|
-
When you're integrating with an OAuth provider,
|
166
|
-
we think that the user's email address is the best "primary key" when linking to your `User` model in your app.
|
167
|
-
Unfortunately in Django, by default an email address is not required to be unique!
|
168
|
-
**We strongly recommend you require email addresses to be unique in your app.**
|
169
|
-
|
170
|
-
[As suggested by the Django docs](https://docs.djangoproject.com/en/4.0/topics/auth/customizing/#using-a-custom-user-model-when-starting-a-project),
|
171
|
-
one way to do this is to have your own `User` model:
|
172
|
-
|
173
|
-
```python
|
174
|
-
# In an app named "users", for example
|
175
|
-
from plain.auth.models import BaseUser
|
176
|
-
|
177
|
-
class User(BaseUser):
|
178
|
-
email = models.EmailField(unique=True)
|
179
|
-
|
180
|
-
|
181
|
-
# In settings.py
|
182
|
-
AUTH_USER_MODEL = 'users.User'
|
183
|
-
```
|
184
|
-
|
185
|
-
You'll also notice that there are no "email confirmation" or "email verification" flows in this library.
|
186
|
-
This is also intentional.
|
187
|
-
You can implement something like that yourself if you need to,
|
188
|
-
but the easier solution in our opinion is to use an OAuth provider you *trust to have done that already*.
|
189
|
-
If you look at our [provider examples](https://github.com/forgepackages/plain-oauth/tree/master/provider_examples) you'll notice how we often use provider APIs to get the email address which is "primary" and "verified" already.
|
190
|
-
If they've already done that work,
|
191
|
-
then we can just use that information.
|
192
|
-
|
193
165
|
### Handling OAuth errors
|
194
166
|
|
195
167
|
The most common error you'll run into is if an existing user clicks a login button,
|
@@ -298,7 +270,7 @@ python manage.py check --database default
|
|
298
270
|
|
299
271
|
## FAQs
|
300
272
|
|
301
|
-
### How is this different from [
|
273
|
+
### How is this different from [Django OAuth libraries](https://djangopackages.org/grids/g/oauth/)?
|
302
274
|
|
303
275
|
The short answer is that *it does less*.
|
304
276
|
|
@@ -1,6 +1,7 @@
|
|
1
|
-
plain/oauth/README.md,sha256=
|
1
|
+
plain/oauth/README.md,sha256=IKgxp_goFYettLZBjHzUHctbavXvhQtg4ZjMWaQCD0I,10010
|
2
2
|
plain/oauth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
plain/oauth/config.py,sha256=jk5l59taT_3Kh7EFrJuuubtrCHLfNBVkD2sWQ_M5_JQ,160
|
4
|
+
plain/oauth/default_settings.py,sha256=dlN1J9vSOjjxPNLp-0qe-cLTqwM4E69ZAx_8lpxMhaM,28
|
4
5
|
plain/oauth/exceptions.py,sha256=TMGtIGkK3_J4rsEy1oPCmia7BnRSK8N8RMZm4_pNelA,189
|
5
6
|
plain/oauth/migrations/0001_initial.py,sha256=8-JR2McXDUNRhMRUrrZPqzRNpdROfCsIo5Qkndkn-pg,1756
|
6
7
|
plain/oauth/migrations/0002_alter_oauthconnection_options_and_more.py,sha256=3Mb0IU9KDRQfog0PjVbzuNv_AxCs7UVHnA0F263AKNo,581
|
@@ -14,7 +15,7 @@ plain/oauth/staff.py,sha256=NtmyFURkKMH6hRp7sjl8FUWYOGSA7M0tLKRyXUciPj4,1288
|
|
14
15
|
plain/oauth/templates/oauth/error.html,sha256=xkkWw57sZ3fz4dDfH30SVtq3okJNnJmrSRPfGxrxjh8,108
|
15
16
|
plain/oauth/urls.py,sha256=NyP_yDKayJYrCdw4oNVHUmtjbLNfzdnpdWc-eOsMlDM,676
|
16
17
|
plain/oauth/views.py,sha256=G6icfdKkOOOKB00JVN4SCeZmBcGOGUvAgueyvOd9bLI,3042
|
17
|
-
plain_oauth-0.7.
|
18
|
-
plain_oauth-0.7.
|
19
|
-
plain_oauth-0.7.
|
20
|
-
plain_oauth-0.7.
|
18
|
+
plain_oauth-0.7.2.dist-info/LICENSE,sha256=cvKM3OlqHx3ijD6e34zsSUkPvzl-ya3Dd63A6EHL94U,1500
|
19
|
+
plain_oauth-0.7.2.dist-info/METADATA,sha256=yE0Hosfe4lzQkOTuIanmEKKFk2SPLwTMyr2h7EPSDUI,10857
|
20
|
+
plain_oauth-0.7.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
21
|
+
plain_oauth-0.7.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|