reset password
Author Message
hensan
Posts: 23
Posted 15:06 Aug 17, 2015 |

Do we need to modify the register page to reflect the addition of the username in the database?

cysun
Posts: 2935
Posted 15:18 Aug 17, 2015 |

What username? email is username.

hensan
Posts: 23
Posted 15:32 Aug 17, 2015 |

I know email is the username, but with the implementation of the userService we added the username variable into the database, so do we make the modifications to reflect the additions.

From the security lecture, slide 23, you have the three required variables username, password and enabled, plus the id and the email in the user class which is translate it into the database schema users and authorities, so I'm not sure if we need to create a username in our users table and if we are, do we need to modify our user registration page since the username and email can't be null?

cysun
Posts: 2935
Posted 15:33 Aug 17, 2015 |

No, you don't need to add a username field. Customize Spring Security so it uses the email field as username.

Last edited by cysun at 15:34 Aug 17, 2015.
bseemscs
Posts: 26
Posted 19:50 Aug 18, 2015 |

Does this also mean we customize Spring Security so it does not need an enabled field in the user table or should our user table have the enabled field?

cysun
Posts: 2935
Posted 06:29 Aug 23, 2015 |
bseemscs wrote:

Does this also mean we customize Spring Security so it does not need an enabled field in the user table or should our user table have the enabled field?

Although it's possible to customize Spring Security to not to use an enabled field, it's usually better to have it as it provides a way to disable a user account without actually deleting it.