0

アプリケーションの sso を作成し、ユーザー テーブルを結合する必要があります。

ユーザー名やパスワードを使用せずに、メール認証で春のセキュリティを使用したい。

これどうやってするの?

私の制限:

  • 1 人のユーザーが複数のメールで認証可能 (github など)
  • ユーザーは、すべての認証状態を管理し、特定の認証を期限切れにすることができます。(プロフィールページにあります)
  • いいえpassword。文字列usernameまたはid. (基本的なログインをサポートするサービスがないため)
    --- 編集 ---
  • OAuth 2.0 / 1.0a 認証

生成されたスキーム: (これはこのケースに適していますか?)


create table hib_authentication (
        id BIGINT UNSIGNED not null auto_increment,
        firstAuthenticatedTime TIMESTAMP DEFAULT CURRENT_TIMESTAMP not null,
        ip VARBINARY(16) not null,
        browser VARBINARY(24) not null,
        lastAuthenticatedTime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP not null,
        user_id INT UNSIGNED not null,
        primary key (id)
    ) ENGINE=InnoDB;
    create table hib_user (
        id INT UNSIGNED not null auto_increment,
        country SMALLINT UNSIGNED not null,
        created TIMESTAMP DEFAULT CURRENT_TIMESTAMP not null,
        locale varchar(255) not null,
        timeZone varchar(255) not null,
        primary key (id)
    ) ENGINE=InnoDB;
    create table hib_user_email (
        id BIGINT UNSIGNED not null auto_increment,
        email varchar(255) not null,
        user_id INT UNSIGNED not null,
        primary key (id)
    ) ENGINE=InnoDB;
    create index index_to_get_authentication_by_user on hib_authentication (user_id);
    alter table hib_user_email 
        add constraint UK_isuygi7fmcwnlht8f4plckt6n  unique (email);
    create index index_to_search_email_by_user on hib_user_email (user_id);
    alter table hib_authentication 
        add constraint authentication_belongs_to_user 
        foreign key (user_id) 
        references hib_user (id);
    alter table hib_user_email 
        add constraint email_belongs_to_user 
        foreign key (user_id) 
        references hib_user (id);

4

0 に答える 0