GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Spring Lemon JPA Guide

Spring Lemon JPA Guide

Jump to bottom
Sanjay Patel edited this page Jan 22, 2019 · 11 revisions

spring-lemon-jpa is one of the leafs in the spring-lemon set of libraries, which your monoliths or authentication services can use. It adds authentication functionalities to spring-lemon-commons-jpa. It comes with a lot of things, which are discussed below.

AbstractUser

AbstractUser comes with the essential user fields, such as email and password. Your User entity should inherit this. To know how, refer to the getting started guide.

Adding roles to your application

The roles field of AbstractUser holds all the user roles. It's a set of String, and so you're free to add any custom roles you may want to use in your application.

Security configuration

LemonJpaSecurityConfig, along with all the helper beans in the com.naturalprogrammer.spring.lemon.security package, are responsible for configuring security of your application. This package is packed with many beautiful features, like stateless social signup/login.

It's quite customizable — provide your own bean to override a built-in one. A simple example is MySecurityConfig in the lemon-demo-jpa project.

Email Validation for uniqueness

UniqueEmail and UniqueEmailValidator define a constraint that's used in AbstractUser for ensuring uniqueness of emails of the user.

LemonController and LemonService

LemonController and LemonService classes define a user-module API. You'll need to extend these. To know how, refer to the getting started guide.

LemonService is composed of many protected methods, which could be overridden for any customization.

LemonUtils

LemonUtils contains a couple of utility methods, e.g. for logging in a user programmatically.

Clone this wiki locally

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.