18 Jul 2015

Usergrid Reset Password Server Config

Usergrid has basic information on the password reset process but nothing that covers the server configuration changes required to support it if you're running your own Usergrid server. This is a summary of the steps to configure the Usergrid server to support password reset.

I posted a question on the Apigee support forum regarding the issues I ran into and this post is a summary of the configuration steps I performed.

Usergrid Server

I'm running two Usergrid servers on Linux. On my development machine I'm using Docker to run a server based on the gaborwnuk/usergrid image. This image does not have the Usergrid Portal so I may switch to neilellis/usergrid at some point.

usergrid-custom.properties

Usergrid server properties can be set by creating a file called usergrid-custom.properties in the tomcat lib directory. There's an example file here and another good example file here. On my systems the file is

/usr/share/tomcat7/lib/usergrid-custom.properties

Mail Server Settings

Create the following entries in your properties file and set them for your mail server. For gmail, when I first sent a password reset, I received a warning that an app was using my account and had to approve use of the account by the app.

mail.transport.protocol=smtps
mail.smtps.host=smtp.gmail.com
mail.smtps.port=465
mail.smtps.auth=true
mail.smtps.username=
mail.smtps.password=
mail.smtps.quitwait=false

URL Settings

Add the following to your properties file and set the hostname value with your server name.

usergrid.user.activation.url=http://:8080/%s/users/%s/activate
usergrid.user.confirmation.url=http://<host>:8080/%s/%s/users/%s/confirm
usergrid.user.resetpw.url=http://<host>:8080/%s/users/%s/resetpw

email Form

The following entry can be used to configure the email sent to the user on reset:

usergrid.management.email.user-password-reset=\
 <p>To reset your password, click here:</p>\n\
 <p><a href="${reset_url}">${reset_url}</a></p>

For admin user resets:

usergrid.management.email.admin-password-reset=\
 <p>To reset your password, click here:</p>\n\
 <p><a href="${reset_url}">${reset_url}</a></p>

HTML Forms

There are four HTML forms associated with resetting passwords. They're all under the directory:

/usr/share/tomcat7/webapps/ROOT/WEB-INF/jsp/org/apache/usergrid/rest

The reset email form can be found here:

management/users/UsersResource/resetpw_email_form.jsp

The reset email form can be found here:

management/users/UserResource/resetpw_email_form.jsp

The reset user form is here:

applications/users/UsersResource/resetpw_email_form.jsp

The reset user form is here:

applications/users/UserResource/resetpw_email_form.jsp

Tags:
0 comments