Auth with SSO (#387)
* add logout v2 for sso * support sms-code login * use db instead of memory cache for login code * feature: support reset password by sms code * remove deprecated api/code * feature: support image captcha * use db instead of memory cache for sso.auth.state * add authLogin for login, v1/login; support (*)[.local].tpl for tpl file * add username to sms-code api * disable captcha by default in rdb.yml
This commit is contained in:
parent
2d1a2fd187
commit
b2baef0643
2
control
2
control
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# release version
|
# release version
|
||||||
version=3.2.0
|
version=3.3.0
|
||||||
|
|
||||||
CWD=$(cd $(dirname $0)/; pwd)
|
CWD=$(cd $(dirname $0)/; pwd)
|
||||||
cd $CWD
|
cd $CWD
|
||||||
|
|
|
@ -24,7 +24,7 @@ sso:
|
||||||
coverAttributes: false
|
coverAttributes: false
|
||||||
stateExpiresIn: 300
|
stateExpiresIn: 300
|
||||||
|
|
||||||
captcha: true
|
captcha: false
|
||||||
|
|
||||||
tokens:
|
tokens:
|
||||||
- rdb-builtin-token
|
- rdb-builtin-token
|
||||||
|
|
|
@ -297,18 +297,17 @@ CREATE TABLE `login_code`
|
||||||
DEFAULT CHARSET = utf8;
|
DEFAULT CHARSET = utf8;
|
||||||
|
|
||||||
CREATE TABLE `auth_state` (
|
CREATE TABLE `auth_state` (
|
||||||
`state` varchar(128) DEFAULT '' NOT NULL,
|
`state` varchar(128) DEFAULT '' NOT NULL,
|
||||||
`typ` varchar(32) DEFAULT '' NOT NULL COMMENT 'response_type',
|
`typ` varchar(32) DEFAULT '' NOT NULL COMMENT 'response_type',
|
||||||
`redirect` varchar(1024) DEFAULT '' NOT NULL,
|
`redirect` varchar(1024) DEFAULT '' NOT NULL,
|
||||||
`expires_at` bigint DEFAULT '0' NOT NULL,
|
`expires_at` bigint DEFAULT '0' NOT NULL,
|
||||||
PRIMARY KEY (`state`)
|
PRIMARY KEY (`state`)
|
||||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8;
|
) ENGINE = InnoDB DEFAULT CHARSET = utf8;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE `captcha` (
|
CREATE TABLE `captcha` (
|
||||||
`captcha_id` varchar(128) NOT NULL,
|
`captcha_id` varchar(128) NOT NULL,
|
||||||
`answer` varchar(128) DEFAULT '' NOT NULL,
|
`answer` varchar(128) DEFAULT '' NOT NULL,
|
||||||
`created_at` bigint DEFAULT '0' NOT NULL,
|
`created_at` bigint DEFAULT '0' NOT NULL,
|
||||||
KEY (`captcha_id`, `answer`),
|
KEY (`captcha_id`, `answer`),
|
||||||
KEY (`created_at`)
|
KEY (`created_at`)
|
||||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8;
|
) ENGINE = InnoDB DEFAULT CHARSET = utf8;
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
set names utf8;
|
||||||
|
use n9e_rdb;
|
||||||
|
|
||||||
|
CREATE TABLE `login_code`
|
||||||
|
(
|
||||||
|
`username` varchar(64) not null comment 'login name, cannot rename',
|
||||||
|
`code` varchar(32) not null,
|
||||||
|
`login_type` varchar(32) not null,
|
||||||
|
`created_at` bigint not null comment 'created at',
|
||||||
|
KEY (`code`),
|
||||||
|
KEY (`created_at`),
|
||||||
|
UNIQUE KEY (`username`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8;
|
||||||
|
|
||||||
|
CREATE TABLE `auth_state` (
|
||||||
|
`state` varchar(128) DEFAULT '' NOT NULL,
|
||||||
|
`typ` varchar(32) DEFAULT '' NOT NULL COMMENT 'response_type',
|
||||||
|
`redirect` varchar(1024) DEFAULT '' NOT NULL,
|
||||||
|
`expires_at` bigint DEFAULT '0' NOT NULL,
|
||||||
|
PRIMARY KEY (`state`)
|
||||||
|
) ENGINE = InnoDB DEFAULT CHARSET = utf8;
|
||||||
|
|
||||||
|
CREATE TABLE `captcha` (
|
||||||
|
`captcha_id` varchar(128) NOT NULL,
|
||||||
|
`answer` varchar(128) DEFAULT '' NOT NULL,
|
||||||
|
`created_at` bigint DEFAULT '0' NOT NULL,
|
||||||
|
KEY (`captcha_id`, `answer`),
|
||||||
|
KEY (`created_at`)
|
||||||
|
) ENGINE = InnoDB DEFAULT CHARSET = utf8;
|
Loading…
Reference in New Issue