ubccr / mokey

FreeIPA self-service account management portal
BSD 3-Clause "New" or "Revised" License
192 stars 47 forks source link

Make URL context path configurable do not require security questions #17

Closed joerg closed 6 years ago

joerg commented 6 years ago

Hi,

We are currently switching from our old LDAP Server to IPA and we want to use mokey for password resets. There are two things that are bothering us a bit, although we will probably be able to use mokey anyways.

1: We need to set a root context path for mokey so the it will be available via https://url.com/mokey/. 2: It is possible to deactivate the security question for password resets, but when a user tries to log in he is still asked to provide a security question. It would be nice if those security questions could be turned off completely.

Apart from this: Great app. Thanks and keep it up!

regards, Jörg

joerg commented 6 years ago

Regarding the context path:

I am not a GO developer, but am I right that this needs just a small adjustment in server.go?

viper.SetDefault("context_path", "")
...

// Public
    router.PathPrefix(viper.GetString("context_path") + "/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir(fmt.Sprintf("%s/static", ctx.Tmpldir)))))
    router.Path(viper.GetString("context_path") + "/auth/login").Handler(handlers.RateLimit(ctx, handlers.LoginHandler(ctx))).Methods("GET", "POST")
    router.Path(viper.GetString("context_path") + "/auth/logout").Handler(handlers.LogoutHandler(ctx)).Methods("GET")
    router.Path(viper.GetString("context_path") + "/auth/forgotpw").Handler(handlers.RateLimit(ctx, handlers.ForgotPasswordHandler(ctx))).Methods("GET", "POST")

    // Token required
    router.Path(fmt.Sprintf(viper.GetString("context_path") + "/auth/setup/{token:%s}", app.TokenRegex)).Handler(handlers.SetupAccountHandler(ctx)).Methods("GET", "POST")
    router.Path(fmt.Sprintf(viper.GetString("context_path") + "/auth/resetpw/{token:%s}", app.TokenRegex)).Handler(handlers.ResetPasswordHandler(ctx)).Methods("GET", "POST")
...
aebruno commented 6 years ago

@joerg We're about to release a new version of mokey (v0.5.1) that completely removes the security question and also adds user sign up. We should be releasing soon.

Regarding the context path, yes we should be able to include this feature in the next release.

joerg commented 6 years ago

Amazing. This is great news, thanks a lot!

P.S.: I found that the README still mentions IPA 4.1 as a requirement. Maybe you could update them for this release. ;-)