You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background
In some scenario, we need to support user login with multiple types, such as login by register username, register mobile or some third party SSO account.
Currently
You could define which field need AAA checked for login by overriding the method protected String userKey(). But once you fixed the value, AAA could not change the checking field.
For example:
I have a user in my database as follow, and I want to support user could log in with login_name, mobile, and email.
User of database
`id`BIGINTNOT NULL AUTO_INCREMENT COMMENT 'PK',
`login_name`VARCHAR(63) NULL COMMENT 'login name',
`mobile`VARCHAR(31) NULL COMMENT 'login mobile',
`email`VARCHAR(127) NULL COMMENT 'login email',
`password`VARCHAR(63) NOT NULL COMMENT 'password in sha1',
`salt`VARCHAR(31) NOT NULL COMMENT 'salt for password',
`state`VARCHAR(31) NOT NULL DEFAULT '' COMMENT 'user state',
If you want to change the login type, you need to modify the USER_KEY. But this could not change dynamically. And there another issue, we could not get the login type from login request to AAA.
Workaround
Here I have a workaround for this kind of situation.
Background
In some scenario, we need to support user login with multiple types, such as login by register username, register mobile or some third party SSO account.
Currently
You could define which field need AAA checked for login by overriding the method
protected String userKey()
. But once you fixed the value, AAA could not change the checking field.For example:
I have a user in my database as follow, and I want to support user could log in with login_name, mobile, and email.
User of database
User entity
Currently, in AAA framework, we could only bind a fixed field. It means we could only support the type of loginName to log in.
If you want to change the login type, you need to modify the USER_KEY. But this could not change dynamically.
And there another issue, we could not get the login type from login request to AAA.
Workaround
Here I have a workaround for this kind of situation.
@greenlaw110 do you have any other better solution, or could you plan enhancement AAA to support this kind of requirement.
The text was updated successfully, but these errors were encountered: