GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Spring Lemon Commons Guide Spring Lemon Commons Guide
Sanjay Patel edited this page
Spring Lemon comes with LemonJwsService and LemonJweService aren't used directly in Spring Lemon. Instead, Spring Lemon uses BlueTokenService for creating/parsing authorization tokens, and GreenTokenService for creating/parsing other tokens (like forgot-password token). They are defined as beans in @Bean @ConditionalOnMissingBean(BlueTokenService.class) public BlueTokenService blueTokenService(LemonProperties properties) throws JOSEException { return new LemonJwsService(properties.getJwt().getSecret()); } @Bean @ConditionalOnMissingBean(GreenTokenService.class) public GreenTokenService greenTokenService(LemonProperties properties) throws KeyLengthException { return new LemonJweService(properties.getJwt().getSecret()); } Noticed the Do you know that Spring Security provides a hasPermission expression, which can be used as below: @PreAuthorize("hasPermission(#fooParam, 'xyz')") public void doSomething(Foo fooParam) { The above would ensure that the current user has But for this to work, you'll need to provide an implementation of the PermissionEvaluator interface.
For more details, look at the source code of
All Spring Lemon related properties are injected into the
Notice that it expects an Spring Lemon Commons comes with a bunch of exception handlers, which are coded in the com.naturalprogrammer.spring.lemon.commons.exceptions.handlers package. Spring Lemon sends mails by using a bean that implements its @Bean @ConditionalOnMissingBean(MailSender.class) @ConditionalOnProperty(name="spring.mail.host", havingValue="foo", matchIfMissing=true) public MailSender<?> mockMailSender() { return new MockMailSender(); } @Bean @ConditionalOnMissingBean(MailSender.class) @ConditionalOnProperty("spring.mail.host") public MailSender<?> smtpMailSender(JavaMailSender javaMailSender) { return new SmtpMailSender(javaMailSender); } So, providing SMTP configuration properties in your application will have the SmtpMailSender configured. Otherwise the MockMailSender will be configured, which just writes the mail to the log. As like most other Spring Lemon beans, providing your own will replace Spring Lemon's. Spring Lemon supports Google reCAPTCHA v2 validation by providing a To understand how it works, have a look at Spring Lemon Commons also comes with a couple of more validation constraints, viz. Last but not the least, do have a look at the 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. |