5/20/2023 0 Comments Apache http client oauth![]() The default authentication schemes may be set globally, using the DEFAULT_AUTHENTICATION_CLASSES setting. The value of er and th for unauthenticated requests can be modified using the UNAUTHENTICATED_USER and UNAUTHENTICATED_TOKEN settings. If no class authenticates, er will be set to an instance of .AnonymousUser, and th will be set to None. REST framework will attempt to authenticate with each class in the list, and will set er and th using the return value of the first class that successfully authenticates. The authentication schemes are always defined as a list of classes. Note: Don't forget that authentication by itself won't allow or disallow an incoming request, it simply identifies the credentials that the request was made with.įor information on how to set up the permission policies for your API please see the permissions documentation. The th property is used for any additional authentication information, for example, it may be used to represent an authentication token that the request was signed with. The er property will typically be set to an instance of the th package's User class. REST framework provides several authentication schemes out of the box, and also allows you to implement custom schemes.Īuthentication always runs at the very start of the view, before the permission and throttling checks occur, and before any other code is allowed to proceed. The permission and throttling policies can then use those credentials to determine if the request should be permitted. Jacob Kaplan-Moss, "REST worst practices"Īuthentication is the mechanism of associating an incoming request with a set of identifying credentials, such as the user the request came from, or the token that it was signed with.
0 Comments
Leave a Reply. |