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
h
e
a
c
c
e
s
s
a
n
d
r
e
f
r
e
s
h
t
o
k
e
n
f
o
r
a
u
t
h
e
n
t
i
c
a
t
i
o
n
ロ
グ
イ
ン
し
た
い
と
き
は
都
度
、
上
の
G
E
T
-
>
P
O
S
T
を
繰
り
返
す
s
e
t
t
i
n
g
s
.
p
y
の
A
U
T
H
E
N
T
I
C
A
T
I
O
N
_
B
A
C
K
E
N
D
S
Related
Sort by
Related
Modified
Created
Last visited
Most linked
Page rank
Title
Links
djoser
https://pypi.org/project/djoser/>REST implementation of #Django authentication system#drf[** エンドポイントを追加する]だけSimilar projects
djoser
Social Endpoints (djoser)
https://djoser.readthedocs.io/en/latest/social_endpoints.html#djoserbeta qualityとのこと>The list of providers is available at social backend docs.https://python-social-auth.readthedocs.io/en/latest/backends/index.html#social-backends
Authentication (DRF)
https://www.django-rest-framework.org/api-guide/authentication/#DRFSetting the authentication scheme>The default authentication schemes may be set globally, using the DEFAULT_AUTHENTICATION_CLASSES setting.
hvitis/social-djoser-template
https://github.com/hvitis/social-djoser-template#DRF #djoser記事版 https://www.hvitis.dev/blog/django-oauth-social-tutorial-how-to-implement-google-login-with-djoser続き https://www.hvitis.dev/blog/oauth-django-djoser-tutorial-vuejs-facebook-one-click-button
第7章 DRFと認証
トークン認証djoserではなく、[* DRFの機能]!DEFAULT_AUTHENTICATION_CLASSESに`rest_framework.authentication.TokenAuthentication`を追加[djoser]で「REST APIの認証系エンドポイントを簡単に追加」👉[TokenAuthentication (DRF API Reference)]
Created
a year ago
by
nikkie
Updated
a year ago
by
nikkie
Views: 32
Page rank: 1
Copy link
Copy readable link
Start presentation
Hide dots
Google Authentication using django and djoser
https://medium.com/@nitesht.calcgen/google-authentication-using-django-and-djoser-b0ef5f61a50b
#djoser
NOTE : Before we start make sure you have created the django project with simple-jwt configured.
GET
http://127.0.0.1:8000/auth/o/google-oauth2/?redirect_uri=http://localhost:3000/
you will get a authorization_url
authorization_url をクリックするとGoogleの認証画面(アカウントを選ぶ)
GETのURLに入れたredirect_urlへ
POST
http://127.0.0.1:8000/auth/o/google-oauth2/?state=''&code=''
google will provide you with the access and refresh token for authentication
ログインしたいときは都度、上のGET -> POSTを繰り返す
settings.pyの
AUTHENTICATION_BACKENDS