andrewarrow/paradise_ftp

how handle authorization

Closed this issue · 1 comments

Hi, I can't found in the doc how login with credentials, please let me know how do it, thanks!!.

Sure, look at this file:

https://github.com/andrewarrow/paradise_ftp/blob/master/paradise/auth_system.go

You need to implement the CheckUser method in your own implementation of the AuthSystem interface.

When you start the server:

    fm := paradise.NewDefaultFileSystem()
    am := paradise.NewDefaultAuthSystem()
    server.Start(fm, am)

notice you pass in a FileSystem and a AuthSystem.

The params passed into CheckUser should be everything you need to validate the password. And you might consider using https://developer.bitium.com to handle this. Or you can check a linux system or a flat file, or anything you want really.