diff --git a/sapl/api/urls.py b/sapl/api/urls.py index 1dfea3901..ddfa93df4 100644 --- a/sapl/api/urls.py +++ b/sapl/api/urls.py @@ -2,6 +2,7 @@ from django.conf.urls import include, url from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView, \ SpectacularRedocView +from rest_framework.authtoken.views import obtain_auth_token from rest_framework.routers import DefaultRouter from sapl.api.deprecated import MateriaLegislativaViewSet, SessaoPlenariaViewSet, \ @@ -12,6 +13,7 @@ from sapl.api.viewset import SaplApiViewSetConstrutor from .apps import AppConfig + app_name = AppConfig.name router = DefaultRouter() @@ -53,6 +55,8 @@ urlpatterns = [ url(r'^api/version', AppVersionView.as_view()), url(r'^api/recriar-token/(?P\d*)$', recria_token, name="recria_token"), + url(r'^api/auth/token$', obtain_auth_token), + # implementar caminho para autenticaĆ§Ć£o # https://www.django-rest-framework.org/tutorial/4-authentication-and-permissions/ # url(r'^api/auth/', include('rest_framework.urls', namespace='rest_framework')),