Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Responsed Unauthorized 401 in AllowAny permission #8722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
junngo opened this issue Oct 20, 2022 · 2 comments
Closed

Responsed Unauthorized 401 in AllowAny permission #8722

junngo opened this issue Oct 20, 2022 · 2 comments

Comments

@junngo
Copy link

junngo commented Oct 20, 2022

Hi there :)
I'd like to know you about this situation and this is just a suggestion.

I happened a similar problem in case #2383
I set AllowAny permission, and DRF returns an Unauthorized 401 response.
The reason is If you call API with Authorization property such as Authorization: Bearer null[0], It return 401.

Regardless of whether there is Authorization property or not, should we consider not causing 401 in AllowAny permission?

[0]
Screenshot from 2022-10-20 10-49-57

@struckchure
Copy link

AllowAny tries to verify the token if it exists, if it doesn't exist, it moves on. Passing a null value would raise a 401 as expected, the way I see it, you just shouldn't pass the token if it's not valid

@stale
Copy link

stale bot commented Dec 23, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 23, 2022
@auvipy auvipy removed the stale label Dec 24, 2022
@encode encode locked and limited conversation to collaborators Dec 24, 2022
@auvipy auvipy converted this issue into discussion #8812 Dec 24, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants