我知道通过内存身份验证,我们可以保护Spring boot rest API(它使用默认身份验证创建随机JWT令牌)。我的要求是我已经通过oracle rest服务创建了JWT令牌,使用这个令牌我需要保护我的spring boot rest api。我如何才能做到这一点?有什么需要帮忙的吗? 类似于下面的问题,Secure REST Api with Spring boot and JWT 向Raj致敬
我想测试一个API,它包含以下指令:
This API requires the caller to have an authenticated user web session.
当我登录到应用程序并在其他选项卡中发送GET请求时,它可以工作。但是我现在想发送一个PUT请求,所以我不能使用浏览器。如何在通过其他rest客户端发送请求时拥有经过身份验证的用户会话。例如: postman/ mozilla rest客户端。
我尝试过通过chrome登录应用程序,然后使用postman rest client。但它并没有起作用。我还尝试了提供应用程序用户名和密码的基本身份验证。
我是DRF (Django Rest Framework)的初学者。我试图在api调用中使用带有令牌的身份验证。
我做过这件事
1-在创建新用户时:
from django.db.models.signals import post_save
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from django.conf import settings
# This code is triggered whenever a new user has been cre