PerlDancer / PerlDancer/Dancer2-Plugin-Auth-Extensible
Authentication with headers without login screen
Nobody has claimed this yet.
- Dominant language
- Perl
- Stars
- 10
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
In test setups we use Dancer2::Plugin::Auth::Extensible::Provider::Config and access the Dancerapp directly
In production enviroments we run Dancer2 behind an apche server. Authentication is also done by the apache server. For instance using Shibboleth. Typically the apache server sets some headers like X-Forwarded-User or X-Auth-User.
I wrote a Dancer2::Plugin::Auth::Extensible::Provider::Header that can pick up the username and roles from the headers in the request. The problem is that I don't find an entry point in the authentication code without going through a login screen. Standard a redirect to /login is done. It 's possible to change it to a post using "login_without_redirect". But I want no login screen. I just need to creat a session based on the header values
I now set the login login in the beforehook of my dancer app. But this is something that has to be added going from test to production. I want this functionality in the Dancer2::Plugin::Auth::Extensible::Provider::Header plugin. How can I implement this ?
hook 'before' => sub {
session logged_in_user => 'myusername'; # is picked up from a header.
session logged_in_user_realm => 'shibboleth';
};
get '/secure' => require_login sub {
return logged_in_user;
};
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the authentication flow around require_login and the before hook, then compare Provider::Config with the proposed Provider::Header. Check how session logged_in_user and logged_in_user_realm are used; done means header-derived identity and roles create a session without redirecting to /login.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- perl
- Domain
- authentication
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100