org.rapidpm.vaadin:flow-security

Dependencies for the Java/Kotlin projects

License

License

Categories

Categories

Vaadin User Interface Web Frameworks Security
GroupId

GroupId

org.rapidpm.vaadin
ArtifactId

ArtifactId

flow-security
Last Version

Last Version

00.12.00-RPM
Release Date

Release Date

Type

Type

jar
Description

Description

Dependencies for the Java/Kotlin projects
Project URL

Project URL

https://github.com/vaadin-developer/flow-security
Project Organization

Project Organization

Vaadin
Source Code Management

Source Code Management

https://github.com/vaadin-developer/flow-security

Download flow-security

How to add to project

<!-- https://jarcasting.com/artifacts/org.rapidpm.vaadin/flow-security/ -->
<dependency>
    <groupId>org.rapidpm.vaadin</groupId>
    <artifactId>flow-security</artifactId>
    <version>00.12.00-RPM</version>
</dependency>
// https://jarcasting.com/artifacts/org.rapidpm.vaadin/flow-security/
implementation 'org.rapidpm.vaadin:flow-security:00.12.00-RPM'
// https://jarcasting.com/artifacts/org.rapidpm.vaadin/flow-security/
implementation ("org.rapidpm.vaadin:flow-security:00.12.00-RPM")
'org.rapidpm.vaadin:flow-security:jar:00.12.00-RPM'
<dependency org="org.rapidpm.vaadin" name="flow-security" rev="00.12.00-RPM">
  <artifact name="flow-security" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.rapidpm.vaadin', module='flow-security', version='00.12.00-RPM')
)
libraryDependencies += "org.rapidpm.vaadin" % "flow-security" % "00.12.00-RPM"
[org.rapidpm.vaadin/flow-security "00.12.00-RPM"]

Dependencies

compile (15)

Group / Artifact Type Version
javax.servlet : javax.servlet-api jar 4.0.1
com.vaadin : vaadin-button-flow jar
com.vaadin : vaadin-checkbox-flow jar
com.vaadin : vaadin-text-field-flow jar
com.vaadin : vaadin-ordered-layout-flow jar
org.rapidpm : rapidpm-vaadin-flow-commons jar 04.05.02-RPM
com.vaadin : flow-server jar
com.vaadin : flow-push jar
com.vaadin : flow-client jar
com.vaadin : flow-html-components jar
com.vaadin : flow-data jar
org.rapidpm : rapidpm-functional-reactive jar 01.00.04-RPM
org.rapidpm : rapidpm-logger-adapter jar 01.00.06-RPM
net.jcip : jcip-annotations jar 1.0
com.google.code.findbugs : jsr305 jar 3.0.2

test (13)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.5.2
org.junit.jupiter : junit-jupiter-params jar 5.5.2
org.junit.platform : junit-platform-launcher jar 1.5.2
org.junit.jupiter : junit-jupiter-engine jar 5.5.2
org.junit.platform : junit-platform-testkit jar 1.5.2
com.google.truth : truth jar 1.0
org.openjdk.jmh : jmh-core jar 1.22
org.openjdk.jmh : jmh-core-benchmarks jar 1.22
org.openjdk.jmh : jmh-generator-annprocess jar 1.22
org.openjdk.jmh : jmh-generator-reflection jar 1.22
com.github.javafaker : javafaker jar 1.0.1
org.slf4j : slf4j-api jar 1.7.28
org.slf4j : slf4j-simple jar 1.7.28

Project Modules

There are no modules declared in this project.
Vaadin Logo

#Vaadin Flow Security How to build different Security Aspects into a Flow Application.

Module flow-security

This module contains all generic parts that could be shared between projects.

Module flow-security-test

This module is a demo app using the module flow-security

Different possibilities

Basic LoginView

This LoginView will have basic elements you need for an authorization. What ever is part of the base LoginView, it will never be the right thing. How to extend this, have a look into the custom implementation in the the demo app. The class name is MyLoginView.

Roles and Permissions

Every System will have its own way to describe Roles and Permission. The only thing I assume here is, that for example a Role will have a name.

public final class RoleName
    extends Single<String> {
  public RoleName(String s) {
    super(s);
  }
  public String roleName() {
    return getT1();
  }
}

The interface HasRoles will be used inside the generic implementation to get access to this information. The custom part will be responsible to map from the existing system to this Interfaces. The demo app will show this inside the class MyAuthorizationService.

  • Login
  • Free View and Restricted Views
  • MenuBar based on User-Roles/Rights
  • Components are visible based on User-Roles/Rights

How to use it in your project

In this section I will describe the steps that are needed to use this in your project. If you want to have a starter app that is always containing this and some other features like I18N, have a look at the following: XXXXX

For every step I will give you the name of the corresponding implementation inside the demo app.

  • Define the class that will hold your user informations inside a session: MyUSer
  • Access to your DataSource including the mapping: UserStorage
  • Define your Role enum: AuthorizationRole
  • Define the Annotation you want to use in your app to declare the role: VisibleFor
  • extend the class RoleAccessEvaluator: MyRoleAccessEvaluator
  • implement the AuthorizationService: MyAuthenticationService

Supported JDK

This example is running from JDK8 up to JDK13

target of this project

The target of this project is a minimal rampup time for a first hello world. Why we need one more HelloWorld? Well, the answer is quite easy. If you have to try something out, or you want to make a small POC to present something, there is no time and budget to create a demo project. You don´t want to copy paste all small things together. Here you will get a Nano-Project that will give you all in a second.

Clone the repo and start editing the file NanoVaadinOnKotlin.kt. Nothing more.

How does it work?

Internally it will ramp up a Jetty. If you want to see how this is done, have a look inside the class CoreUIService.

How a developer can use this

You as a developer can use it like it is shown in the demo folder inside the src path.

fun main() {
  CoreUIService().startup()
}
@Route("")
class VaadinApp : Composite<Div>(), HasLogger {

  private val btnClickMe = Button("click me")
  private val lbClickCount = Span("0")
  private val layout = VerticalLayout(btnClickMe, lbClickCount)

  private var clickcount = 0

  init {
    btnClickMe.setId(BTN_CLICK_ME)
    btnClickMe.addClickListener { event -> lbClickCount.text = (++clickcount).toString() }

    lbClickCount.setId(LB_CLICK_COUNT)

    logger().info("and now..  setting the main content.. ")
    content.add(layout)
  }

  companion object {

    val BTN_CLICK_ME = "btn-click-me"
    val LB_CLICK_COUNT = "lb-click-count"
  }
}

Happy Coding.

if you have any questions: ping me on Twitter https://twitter.com/SvenRuppert or via mail.

org.rapidpm.vaadin

Vaadin Developer

Jumpstarts and HowTos for Vaadin based projects

Versions

Version
00.12.00-RPM
00.11.00-RPM
00.10.00-RPM
00.09.00-RPM
00.08.00-RPM