added support for custom redirect uri

refs #282