tomkuijsten / restup

Webserver for universal windows platform (UWP) apps
MIT License
114 stars 48 forks source link

implement basic authorization module #103

Closed kreuzhofer closed 7 years ago

kreuzhofer commented 7 years ago

@tomkuijsten I habe implemented the basic authorization. To activate it, you add an IAuthorizationProvider to the constructor of RestRouteHandler and StaticFileRouteHandler. So you can define which paths have authorization and which not. I would also like to add this to the wiki if you would make me a contributor of your project. You have to pass an ICredentialValidator to the constructor of the BasicAuthorizationProvider. There you can implement username and password check. Next I would implement another ICredentialValidator with pass through authentication that checks the username/password against the local administrator account, which is also used to log in to the admin interface of the pi. Btw I did not yet write any unit tests but I tested locally and on the raspberry and it works fine.

Jark commented 7 years ago

@kreuzhofer thanks for the contribution, but would you mind recreating the pull request against tomkuijsten:development ? We use that branch for any development.