Skip to content
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

Warden::Strategies::Base#authenticate! documentation is ambiguous #203

Open
ghost opened this issue Mar 16, 2022 · 5 comments
Open

Warden::Strategies::Base#authenticate! documentation is ambiguous #203

ghost opened this issue Mar 16, 2022 · 5 comments

Comments

@ghost
Copy link

ghost commented Mar 16, 2022

There is an issue with the devise-doorkeeper gem that causes the warden.authenticate call to throw when an invalid token is passed.

Devise::Controllers::Helpers#user_signed_in? calls Warden::Proxy#authenticate which ultimately calls Devise::Doorkeeper::Strategies::Doorkeeper#authenticate! which throws if a given token is invalid.

I believe the intent behind user_signed_in? and the Warden::Proxy#authenticate are to be passive auth checks and should not throw. I'm not sure if this is a problem with the implementation of the Strategy or with the implementation of Warden::Proxy#run_strategies_for. I notice that the Strategies wiki does not mention using throw :warden but the Failures wiki does. The documentation on Warden::Strategies::Base is ambiguous.

Does Warden expect that a Strategy's authenticate! method should throw in this case? If it does expect that shouldn't authenticate handle that to ensure the check is passive? If not, I can update the documentation.

@ghost
Copy link
Author

ghost commented Apr 12, 2022

See also betterup/devise-doorkeeper#56

@ittsel-ali
Copy link

@alan-pie were you able to find the solution for this issue?

@ghost
Copy link
Author

ghost commented Oct 14, 2022

No, unfortunately not. Both projects seem dead.

@jsmestad
Copy link
Collaborator

Warden is stable. I wouldn't mistake that for dead. If we have a test case that proves a change will not break downstream dependencies, we will take the patch.

@ghost
Copy link
Author

ghost commented Oct 18, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants