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

make implementing other authentication methods easier #25

Open
sknebel opened this issue Jul 18, 2017 · 5 comments
Open

make implementing other authentication methods easier #25

sknebel opened this issue Jul 18, 2017 · 5 comments
Labels

Comments

@sknebel
Copy link
Collaborator

sknebel commented Jul 18, 2017

Per discussion in IRC today (https://chat.indieweb.org/dev/2017-07-18#t1500403860546000) and offline talks with people, it might be interesting to allow people to easily modify selfauth to use different authentication methods. Right now, a password-based one can already be easily implemented by replacing the password verification function, but e.g. for social logins changes to the form presented to the user are also necessary (and maybe handling of special callbacks?).

An idea in the IRC discussion was to build selfauth as a class, so forks/variations can easily override parts of the functionality.

We want to keep selfauth as one file, so we need a way for variations to include it without actually running the existing code. Given that PHP require seems to work basically as an include, we could check for the presence of a special variable, that code including it could set to disable automatically running functionality. If the file is loaded directly, the variable doesn't exist and it works as it does now.

@aaronpk
Copy link
Contributor

aaronpk commented Jul 18, 2017

this should probably be titled "other authentication methods"

@sknebel sknebel changed the title allow using other auth methods make implementing other authentication methods easier Jul 18, 2017
@aaronpk
Copy link
Contributor

aaronpk commented Jul 18, 2017

Another option is to split the source code for this repo into multiple files and have a sort of "build step" that generates the single-file version that people use. This would be similar to how larger projects exists as dozens of source file and they publish a .zip file as a release.

@Zegnat
Copy link
Collaborator

Zegnat commented Jul 19, 2017

Another option is to split the source code for this repo into multiple files and have a sort of "build step" that generates the single-file version that people use.

Yes, @sknebel and I discussed possibly setting up a build tool (I don’t know a lot for PHP … Phing possibly?). Another option is to go with multifile and distribute a PHAR file, but server support is probably not there for that. See @cweiske’s great Working with .phar files.

@cweiske
Copy link

cweiske commented Jul 19, 2017

No, it will take a while: http://cweiske.de/tagebuch/phar-webserver2.htm

@dissolve
Copy link

We want to keep selfauth as one file

What is the exact reason to needing it to all be one file? I know that was the original idea, but its already using the configs as a separate file. As long as the files are kept simple, where is the issue?

Unless there is a very good reason to not just have an extra file, i would strongly suggest this be done as just multiple files and avoid any build mess. It would also clean up any duplicate code between setup and index as well.

@Zegnat Zegnat added the discuss label Aug 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants