Java Web Application Authentication - Account Creation

I am working on a web project, the backend Javaand Mysql, the client includes web(html5)and app(IOS/Android), I have some doubts about the development of a system account.

There are 3 different types of account:

  • The store , the store will have its own website,
  • Customer , customer store / product through the application (IOS / Android),
  • Admin , manage the entire system.

My main idea of ​​authentication:

The table will have account/ role/ permission, since the administrator and the client will have a rather complicated problem with user rights, the client also has a different permission due to their behavior in history.

I decided to use Apache Shirobecause of its simplicity and distributed session.

My question is:

(1) Should I create a single account table or three separate account tables.

(2) Any design advice for 3 tables:   account/ role/ permission?

+4
source share
5 answers

In short: you don't need role / permission tables :)

, RBAC? 3 : , , . / . (OAuth2, OpenID, LDAP ) . , , RBAC.

+3

Stormpath. Stormpaht , . Stormpath :

  • API SDK: node.js, express, java, rest, python, flask.
  • : , reset.
  • Single Sign-On .
  • API , HTTP Basic Auth OAuth2
  • : Facebook, Google, LinkedIn, Github
  • Shiro Spring
  • Active Directory LDAP

Stormpath Groups, roles. , permissions, .

, Shiro, Shiro Stormpath . , Stormpath Shiro Sample Shiro Web App.

, Stormpath.

+4

, ( admin, ), , , , .
- , " " -/.

-.

, Stormpath, Shiro, OACC, Java , , .

, :

  • .
  • OACC (, ).
  • , , , "admin".

[ : - OACC]

+4

Java . , . ? - ( . extend) implement , ? , , , , , ? ?

Java- , O/R . , , ( , , Packstation boths, , ...).

, , UTF-8 , , .

+2

(1) .

, , , .

(2) 3 : //?

: PK account_id int, FK role_id int

: PK role_id int, account_permission enum (admin [0], [1])

, , , . , - , , . , , , customer_behaviour, " ", .

, .

+1
source

All Articles